gpt4 book ai didi

objective-c - 隐藏搜索栏,直到用户向下滑动 iOS 7

转载 作者:行者123 更新时间:2023-12-02 21:56:43 25 4
gpt4 key购买 nike

我已将搜索栏添加到 TableView 的表头 View 中。然而,写作

self.tableView.contentOffset = CGPointMake(0, 44); 

[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];

将 searchBar 隐藏在顶部导航栏的后面,但即使用户向下滑动 tableview 也不可见。它又躲起来了。这似乎在 iOS 6 中工作正常,但在 iOS 7 beta 中却不行。我需要做什么?

最佳答案

通过放置 .. 修复它

self.edgesForExtendedLayout = UIRectEdgeNone;

viewWillAppear 中,它在执行之前需要检查 iOS 7,因为它是 iOS7 中引入的新方法。

等 ionic

关于objective-c - 隐藏搜索栏,直到用户向下滑动 iOS 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17647844/

25 4 0