UISearchBar height on iOS8 when showsScopeBar=YES

后端 未结 4 990
不思量自难忘°
不思量自难忘° 2020-12-29 10:53

I\'m using UISearchBar in my app, with showsScopeBar=YES. When running under iOS8 (both in the simulator and on a device) the scope bar is hidden a

4条回答
  •  粉色の甜心
    2020-12-29 11:35

    This issue is occurring in the iOS 8 release version as well. I added these 2 lines in my viewWillAppear: and that solved it.

    - (void)adjustSearchBarToShowScopeBar{ [self.searchBar sizeToFit]; self.tableView.tableHeaderView = self.searchBar; } Just adding [self.searchBar sizeToFit] was covering up my tableview's first row. Just refreshing the tableview header fixed the issue perfectly.

提交回复
热议问题