UISearchBarController iOS 11问题 - SearchBar和范围按钮重叠 [英] UISearchBarController iOS 11 issue - SearchBar and scope buttons overlap

查看:112
本文介绍了UISearchBarController iOS 11问题 - SearchBar和范围按钮重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考



iOS 11:





注意:相同的设备相同的代码。

此外,这是否意味着,所有使用此功能的应用都必须重新发布?

解决方案

添加这些行为我修复了它:

 覆盖func viewDidLayoutSubviews(){
self.searchController.searchBar.sizeToFit()
}


Referred here and here. No answer in first link. In the second link, though the answer is not accepted, but the link to apple developer forum gives error.

Before iOS 11 :

iOS 11 :

Note : Same device same code.
Also, this would mean, all apps using this feature have to be republished ?

解决方案

Adding these lines fixed it for me:

override func viewDidLayoutSubviews() {
    self.searchController.searchBar.sizeToFit()
}

这篇关于UISearchBarController iOS 11问题 - SearchBar和范围按钮重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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