gpt4 book ai didi

iphone - 如何隐藏 UISearchBar 创建的 UITableView?

转载 作者:搜寻专家 更新时间:2023-10-30 19:47:18 24 4
gpt4 key购买 nike

在我的 iPhone 应用程序中,我有一个搜索栏和搜索显示 Controller 。当用户在搜索框中键入内容时, TableView 将加载并可见。当用户单击一行时,我想摆脱 tableView 并返回到用户最初单击搜索栏的 View 。我已经搜索了整个文档,我无法在任何地方找到如何执行此操作。我试过 [tableView setHidden:YES]; 但是当用户再次点击搜索栏时,tableView 永远不会返回。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}

请有人能指出我正确的方向。

最佳答案

你可以试一下

[mySerchDisplayController setActive:NO animated:YES];

关于iphone - 如何隐藏 UISearchBar 创建的 UITableView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1915855/

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