UISearchController searchBar showsCancelButton not being respected

后端 未结 12 2325
北荒
北荒 2021-02-13 03:58

I\'ve added a UISearchController to my application and set it\'s searchBar to the titleView of my navigationItem.

This works but I am seeing t

12条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-13 04:07

    This worked for me (iOS 10):

    - (void)viewWillAppear:(BOOL)animated {
          [super viewWillAppear:animated];
          self.searchController.searchBar.showsCancelButton = NO;
    }
    

提交回复
热议问题