Cuong Nguyen
Cuong Nguyen

Reputation: 990

Tweak UI Navigation on iOS 11

I have a problem with a navigation bar in iOS 11. I use this code:

[UINavigationBar appearance].prefersLargeTitles = YES;

...to set a new style for my app. It works well untill a user pull to refresh on the table view; then it breaks.

This is before pull-to-refresh:

enter image description here

...and this is _after:

enter image description here

Note: I use the table view controller's built-in pull-to-refresh control.

I searched for a solution but it still eludes me. If someone knows how to fix this please drop some advice.

Thanks for the support :)

Upvotes: 4

Views: 592

Answers (2)

Vladimir Prigarin
Vladimir Prigarin

Reputation: 474

I have catch this bug too, and we have found the solution.

You must constraint your UITableView to superview (contentView of your view controller), after that large title and all related views starts to work correct.

Like this: enter image description here

Upvotes: 3

fredpi
fredpi

Reputation: 8952

While I do not claim this is the solution for every situation the error occurs in, setting the navigationBar's isTranslucent property to true (which is also the default value) fixed the problem for me.

If you want to keep your navigation bar non-translucent you can use the following code:

navigationBar.barStyle = .blackOpaque

Upvotes: 2

Related Questions