resize UISearchDisplayController dimmed black overlay

后端 未结 3 878
梦毁少年i
梦毁少年i 2021-02-04 17:16

anybody know how to resize the dimmed black overly, once you clicked the search bar ?

i having problem when i clicked cancelled the tableview will expend then animated t

3条回答
  •  余生分开走
    2021-02-04 17:42

    I thought the searchDisplayController owned a seperate tableview, so my guess is that you would need to resize that one.

    Something along the lines of: .view.frame =self.tableView.frame;

    or if you don't have it as class variable, in a method which receives it as argument, eg:

    -(void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView {
       controller.view.frame = self.tableView.frame;
        tableView.backgroundColor = [UIColor colorWithRed:243.0/255.0 green:236.0/255.0 blue:212.0/255.0 alpha:1];   
    }
    

    Alternativily you might want to subclass it and override its view properties locally.

    Hope this helps!

提交回复
热议问题