// 在iOS11 之后适配titleView
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame =CGRectMake(0, 0, kScreenWidth, 44);
self.navigationItem.titleView = button;
_searchBar = [[UISearchBar alloc] initWithBackgroundImage
// 在iOS11 之后适配titleView
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame =CGRectMake(0, 0, kScreenWidth, 44);
self.navigationItem.titleView = button;
_searchBar = [[UISearchBar alloc] initWithBackgroundImage