Tsahi Deri
Tsahi Deri

Reputation: 581

Today widgets height issue

I'm developing an iOS today widget that displaying dynamic content using UITableView. In some cases the widget's content exceeds the height of Notification Center, but when using :

[self setPreferredContentSize:CGSizeMake(self.view.bounds.size.width, contentHeight)];

the OS limit the widget height to be exactly Notification Center visible UI height.

As per Apple documentation, it’s not a good experience when a widget’s height exceeds the height of Notification Center, but no limit is documented :

Avoid making users scroll or vertically shift the view to see all the information in your Today widget. A widget can expand vertically to show more information, but it’s not a good experience when a widget’s height exceeds the height of Notification Center, because it interferes with scrolling to see other Today widgets.

I have played a bit with Apple (built-in) Stocks app and added more than 20 stocks. When I open the Stock widget, first it was displaying several stocks with "See all" button. When I pressed the button I was able to see all stocks list, although the widget's content exceeds the height of Notification Center. (I was needed to scroll in order to see all list).

Does anyone have a clue how to get that experience ad describe above ?

Upvotes: 3

Views: 631

Answers (1)

Tom Harrington
Tom Harrington

Reputation: 70946

From my experience, this option is not currently available to third-party today extensions. The extension environment limits the height, and requesting more has no effect. What's worse is that the actual limit varies depending on screen size, and there's no way to discover the limit at run time except by trial and error.

Apple's apps, and now extensions, have often been exempt from rules that govern third party software. This appears to be another case where this is happening.

I filed a bug (rdar://18408718 in case anyone from Apple sees this) and I encourage you to do the same.

Upvotes: 0

Related Questions