UITableView content overlaps Status Bar when UISearchBar is active

后端 未结 8 624
北海茫月
北海茫月 2021-02-05 02:17

I have a UITableViewController with a UISearchBar and UISearchDisplayController. That exists inside a Container View in a UIViewController which is in a UINavigationController.

8条回答
  •  迷失自我
    2021-02-05 03:09

    The following hack worked for me:

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    {
        return (self.searchController.isActive  && section == 0) ? 22.0f : 0.0f;
    }
    

提交回复
热议问题