resize UISearchDisplayController dimmed black overlay

后端 未结 3 875
梦毁少年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:34

    The UISearchDisplayController does owns its own tableview which not as easy to tame. I came across something like this and am still looking for a better solution.

    -(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller
    {
        [controller.searchResultsTableView setDelegate:self];   
        CGFloat gr = 12.0;
        controller.searchResultsTableView.backgroundColor = [UIColor colorWithRed:gr green:gr blue:gr alpha:0.0];
        [controller.searchResultsTableView setSeparatorStyle:UITableViewCellSelectionStyleNone];
        CGRect searchTableFrame = CGRectMake(7, 105, 305, 292);
        [controller.searchResultsTableView setFrame:searchTableFrame];
    }
    

    The above code does sets the background to transparent but seems to silently ignore the frame size.

    EDIT:SOLVED I found the robust solution to this here. This saved my life.

提交回复
热议问题