iOS 11 UIRefreshControl with NavigationBar LargeTitle and SearchController disappearing

南笙酒味 提交于 2019-11-30 22:17:07

问题


I have a navigationBar with largeTitle and searchcontroller and my tableView has a refreshcontrol.

When I pull to refresh the activityIndicator of refreshcontrol disappear but de refresh process continues, even when the process finish and I call .endRefreshing() of UIRefreshControll the navigationBar doesn't back to the normal size.

Someone with the same problem?


回答1:


I searched a solution for this for weeks already and today, I finally made it work. The solution is so simple, I can't believe I haven't found that earlier.

I was using a normal UIViewController with a UITableView. My layout constraints were setup so that the UITableView was pinned with 0 to the bottom and top layout guides like so:

Once I changed that and pinned the UITableView to the Superview with 0 to all edges, it magically started to work:

I didn't even have to setup anything else. I hope so much that this does the fix for you as well because its just so annoying...


If the above doesn't work, than you need in addition to it, set

self.extendedLayoutIncludesOpaqueBars = YES;

or check the "Extend Edges / Under Opque Bar" in the Storyboard




回答2:


Try

self.extendedLayoutIncludesOpaqueBars = YES;

If you have opaque navigation bars that is. It fixed the issue for me.




回答3:


Try to use this code snippet:

self.navigationController?.navigationBar.prefersLargeTitles = false
self.navigationController?.navigationBar.prefersLargeTitles = true;


来源:https://stackoverflow.com/questions/46793716/ios-11-uirefreshcontrol-with-navigationbar-largetitle-and-searchcontroller-disap

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