Search code examples
ioswidgetios8ios8-extensionios8-today-widget

Is there a way to remove the gap under my Today Extension


Ok, I'm trying to make todays view extension and I would really like to make it have 77 pixels of height. But no matter what iOS keeps inserting a padding under my top view.

Like this:

My view with borders

You see, I'm calling setPreferredContentSize passing a height of 77. But the gap is always there. Even If I set my content size smaller, it gets cut, but the padding is still there and apparently with the same size, the image bellow illustrates:

enter image description here

Does someone have anything to say about this? I'm trying this because Evernote's widget seems to manage to remove that gap, but i'm really stuck, I even disabled autolayout, but nothing.


Solution

  • Try adding the following:

    -(UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets)defaultMarginInsets { return UIEdgeInsetsMake( defaultMarginInsets.top, defaultMarginInsets.left, 0, defaultMarginInsets.right ); }