iOS 11 large title navigation bar snaps instead of smooth transition

六月ゝ 毕业季﹏ 提交于 2019-12-02 18:05:49
Soolar

I faced same issue - I had UIViewController embedded in UINavigationController, the UIViewController had tableview with leading, trailing, top, bottom constraints to safe area. The whole tableview behaved jumpy / snappy. The trick was to change top constraint of tableview to superview.

Here I recorded changing the constraint tableview iOS 11 bug constraint change

Put this line of code on your UIViewController containing UITableView and works fine for me.

Swift

extendedLayoutIncludesOpaqueBars = true;

Objective-C

self.extendedLayoutIncludesOpaqueBars = YES;

Set UITableView AutoLayout top space to "Superview" instead of "Safe Area"

I had a similar looking issue and solved it by removing UINavigationBar.appearance().isTranslucent = false from my AppDelegate.

In Interface Builder:

  1. Select your "viewController".
  2. Attribute Inspector tick "Under Opaque Bars" and "Under Top Bars".
  3. Make your top constraints of your scrollView second Item to "SuperView" not "SafeArea".

It worked with me.

Reference

Soolar's answer is right, but I don't know how to fix it in storyboard. Finally I solved the problem with Roman's solution in another question, by adding:

    NSLayoutConstraint.activate([
    scrollView.topAnchor.constraint(equalTo: view.topAnchor),
    scrollView.leftAnchor.constraint(equalTo: view.leftAnchor),
    scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
    scrollView.rightAnchor.constraint(equalTo: view.rightAnchor)
    ])

in viewDidLoad.

Original answer: https://stackoverflow.com/a/48321447/1386369

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!