iosswiftios8ios8-today-widgettoday-extension

Issue in Widgets in landscape mode


I have this irritating issue with widgets that it trims the content of my view in the landscape mode. I have put the content size statically but it doesn't work. Does Apple restrict the widget to have a specific height in landscape? Apple's interface guidelines says it's not recommended but is it doable?

Edit: enter image description here


Solution

  • There is a height limit for today widgets on iOS. The max height is (screen size) - (notification center UI height). Whatever's left after the notification center draws its UI is left for widgets. That's going to be different in landscape than in portrait.

    Unfortunately this limit is not documented, nor is there any way to look it up at run time. If you request a larger size, you'll get something less than you requested, but there's no way to ask what the limit is. [And if anyone from Apple reads this, please see rdar://18408718, "Today extensions have undocumented, hard to discover size limits"]

    In some cases the notification center seems to impose a lower height limit. This looks like a bug to me but there's no way around it for now.