gpt4 book ai didi

ios - 无法在 searchController 的 searchBar 上停止动画并隐藏取消按钮

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

我在导航栏中设置了我的搜索栏。激活后,它会动画并出现取消按钮。我正在尝试停止动画并防止出现取消按钮。我的 Storyboard是一个设置在导航 Controller 中的 tableviewController。

self.searchController = [[UISearchController alloc]initWithSearchResultsController:nil];
self.searchController.searchResultsUpdater = self;
self.searchController.dimsBackgroundDuringPresentation = NO;
self.searchController.hidesNavigationBarDuringPresentation = NO;

self.searchController.searchBar.frame = CGRectMake(self.searchController.searchBar.frame.origin.x, self.searchController.searchBar.frame.origin.y, self.searchController.searchBar.frame.size.width, 44.0);

self.navigationItem.titleView = self.searchController.searchBar;
[self.searchController.searchBar setShowsCancelButton:NO animated:NO];

最佳答案

试试 [self.searchController.searchBar showsCancelButton:NO] .

关于ios - 无法在 searchController 的 searchBar 上停止动画并隐藏取消按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27429273/

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