I am developing an iOS 8 app with a Notification center widget. One problem I am having is that when I first open the widget, the UIButtons (which are in one UIView) are stretched vertically (even though I did not specify this).
When the user closes notification center or swipes to the notifications tab and then goes back to widgets, the UI returns to its normal state and is perfect and works exactly how I want it to look and behave.
So to confirm, I am only having this issue when the user installs the app and adds the Widget to Notification center for the first time. Then as long as they don't get rid of the widget from the notification center, then its UI is normal. It is only when the user removes and adds the widget again when this issue then happens again (once only).
I am not using Auto Layout (yes I know its recommended, but I can't stand it) and my app is iOS 8 only.
More to the point, once the uses closes notification center or simply swipes to the notifications tab and then returns to the widgets section, my widget UI works perfectly with no issues what so ever.
I have tried to manually set the height of the view containing the UIButtons myself, but it doesn't seem to work. I used this code to do that:
CGRect newFrame = CGRectMake( xCoordinate, yCoordinate, width, height);
myView.frame = newFrame;
Has anyone else experienced this issue? And if so, any ideas on how I can go about fixing it????
Thanks, Dan.
Oh urmmm... ok I literally just fixed this issue by doing the following:
So I basically got rid of the vertical resizing property on the UIView which contains the UIButtons and its fixed....
I must admit, this is odd though because since I want the view to resize (to the size of the view but not longer), this is why I selected this property.
More to the point, for the main app, I had to select this property for the view to resize properly... hmmm.. I guess iOS Widget views resize differently or something.
Oh well, issue fixed :)