SetPreferredContentSize does not work in today's landscape iPhone widgets on iOS8

I am working on Today extension widgets in iOS8 using Xcode beta 6.

I set the frame of my widget to setPreferredContentSize:in. viewWillAppear: It works fine on all iOS devices, except on landscape iPhone.

On iPhone in landscape mode, the height of the widget becomes no more than 166 pixels (in the retina of the iPhone, 332px). And I'm trying to set it to about 300 pixels.

I understand that a tall widget can be bad, as Apple mentioned in the Application Extension Programming Guide , but sometimes the Calendar application gets very tall if there are many schedules.

Since I do not have an iOS8 iPhone, I only tested using simulators. Is this a simulator error?

Any advice would be appreciated.

+4
source share
1 answer

The maximum height of the NC widget is not documented by Apple.

However, in my experience, the maximum height is strictly the screen height minus the controls above and below.

This has the undesirable effect that a widget that works well for an iPad or iPhone 6 plus might not fit on the iPhone in landscape!

This applies to both devices and the iOS simulator (with iOS 8.1.2)

, , NC preferredContentSize.height 210 pt. iPhone 5 205,5 . , .

NC, UITableViews , iPad iPhone, iPhone.

preferredContentSize , . , .

+3

All Articles