swift navigation bar title remove animation

萝らか妹 提交于 2019-12-13 07:35:58

问题


I have added Page Control to the title of navigation bar from Interface Builder. When the view push/pop to the next view, the Page Control animates (as how normally title would animate).

How do i prevent the Page Control from animating?

I have something like this but it didn't work:

self.navigationItem.titleView?.removeMotionEffect(UIMotionEffect())


回答1:


Solved it. I need to create a new Page View Controller to manipulate the Page Control that I have placed on the navigation bar.

Instead of having multiple Page Control on each View Controller, I just have one Page Control on the first page.

And switch between View Controller using Page View Controller instead of doing push/pop.




回答2:


Try

UIView.performWithoutAnimation { () -> Void in
        <#code#>
    }


来源:https://stackoverflow.com/questions/29428022/swift-navigation-bar-title-remove-animation

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