Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.09k stars 1.38k forks source link

UISearchBar 以 tableHeaderView 的方式在 iOS 11 下使用的若干系统 bug #233

Closed MoLice closed 6 years ago

MoLice commented 6 years ago

请填写运行环境

请描述具体问题

示例代码:

UISearchController *searchController = xxx;
searchController.searchBar.barTintColor = Xxx;
tableView.tableHeaderView = searchController.searchBar;

然后点击搜索框,进入搜索模式,搜索框飞到顶部,此时在 iPhone X 下会看到搜索框背景并没有撑满整个状态栏。

该问题在 iOS 11.1 已经被系统修复,因此只需要覆盖 11.0 的版本即可。

image

image

MoLice commented 6 years ago

在 iOS 11 下,以 tableHeaderView 的方式使用 searchBar 的话,进入/退出搜索状态,searchBar 都会有抖动。 这一点与是否 iPhone X 无关。

MoLice commented 6 years ago

横屏模式下进入搜索状态,searchBar 内的输入框偏上,在所有设备、所有 iOS 11.x 版本里均会。

image

MoLice commented 6 years ago

2.1.0 已兼容各种问题,请查看UISearchBar+QMUI