UITableView content overlaps Status Bar when UISearchBar is active

后端 未结 8 627
北海茫月
北海茫月 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

    Try setting the definesPresentationContext in viewDidLoad of your TableViewController

    Swift

    override func viewDidLoad() {
        super.viewDidLoad()
    
        definesPresentationContext = true
    }
    

    Objective-C

    - (void)viewDidLoad {
        [super viewDidLoad];
    
        self.definesPresentationContext = YES;
    }
    

提交回复
热议问题