1

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.

André Henrique
  • 167
  • 1
  • 1
  • 9

1 Answers1

4

Try adding the following:

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

EricS
  • 9,650
  • 2
  • 38
  • 34