带有NavigationBar LargeTitle和SearchController的iOS 11 UIRefreshControl消失了 [英] iOS 11 UIRefreshControl with NavigationBar LargeTitle and SearchController disappearing

查看:62
本文介绍了带有NavigationBar LargeTitle和SearchController的iOS 11 UIRefreshControl消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有largeTitle和searchcontroller的navigationBar,而我的tableView有一个refreshcontrol.

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

当我拉动刷新时,refreshcontrol的activityIndi​​cator消失了,但刷新过程仍在继续,即使该过程完成并且我调用UIRefreshControll的.endRefreshing()时,navigationBar也不会恢复正常大小.

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?

推荐答案

我已经搜索了一个解决方案达数周之久,而今天,我终于使它起作用了.解决方案是如此简单,我简直不敢相信.

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.

我当时在使用带有UITableView的普通UIViewController.设置了我的布局约束,以便UITableView在底部和顶部布局指南中固定为0,如下所示:

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:

一旦我对此进行了更改,并将UITableView固定到Superview的所有边上,且所有边缘的0值都神奇地开始工作:

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

这篇关于带有NavigationBar LargeTitle和SearchController的iOS 11 UIRefreshControl消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆