在iOS 10上将UISearchController与UITableViewController一起使用时,UITableView标头处出现奇怪的空白 [英] Strange white space at UITableView header when using UISearchController with UITableViewController on iOS 10

查看:40
本文介绍了在iOS 10上将UISearchController与UITableViewController一起使用时,UITableView标头处出现奇怪的空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

空白仅出现在iOS 10上.

The white space only appears on iOS 10.

推荐答案

我也遇到了这个问题.如果启用了垂直滚动指示器,则应该可以看到这是 UIScrollView 的插入问题.似乎只有在将 UITableViewcontroller 用作 UISearchController searchResultsController 时,才会发生这种情况.

I ran into this problem as well. If you have the vertical scroll indicator enabled, you should be able to see that it's a UIScrollView's inset issue. And seems like it only happens when you use a UITableViewcontroller as the searchResultsController of a UISearchController.

该多余的空间在视图的顶部和底部均可见.

And this extra space is visible at both the top and bottom of the view.

这个答案并不漂亮,但是我现在要添加它.

This answer is not pretty, but I'm adding this in for now.

if #available(iOS 10.0, *) {
    automaticallyAdjustsScrollViewInsets = false
    tableView.contentInset = UIEdgeInsetsMake(64, 0, 44, 0)
}

这篇关于在iOS 10上将UISearchController与UITableViewController一起使用时,UITableView标头处出现奇怪的空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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