gpt4 book ai didi

ios - 推送时从UISearchController删除搜索栏

转载 作者:行者123 更新时间:2023-12-01 16:25:52 24 4
gpt4 key购买 nike

我有一个搜索栏图标,一旦按下它就会调用它:

SearchTableViewController *searchView = [[SearchTableViewController alloc]initWithNibName:@"SearchTableViewController" bundle:nil];
UINavigationController *navCtlr = [[UINavigationController alloc]initWithRootViewController:searchView];
UISearchController *searchController = [[UISearchController alloc]initWithSearchResultsController:navCtlr];
[searchController setDefinesPresentationContext:YES];
searchController.delegate = searchView;
searchController.searchResultsUpdater = searchView;
searchView.searchController = searchController;
searchController.searchBar.keyboardAppearance = UIKeyboardAppearanceDark;
[self presentViewController:searchController animated:YES completion:nil];

在我的SearchTableViewController.m文件中,我有一个成功调用的推送命令:
 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DetailTableViewController *seeAll = (DetailTableViewController *) [storyboard instantiateViewControllerWithIdentifier:@"DetailTableViewController"];
seeAll.query = self.searchController.searchBar.text;
seeAll.title = @"Songs";
[self.navigationController pushViewController:seeAll animated:YES];

但是,我没有得到预期的行为,即。

预期基于Apple Music的UISearchController:
推送之前:
Before Push

推送后:
After Push

对我来说,发生了什么事:

推送前后是一样的:
Before Push

最佳答案

这是一个重复问题。 answer可能会有所帮助。

您可以从here下载UISearchController演示

关于ios - 推送时从UISearchController删除搜索栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35432907/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com