在我的应用程序中,我有一个 TableView,它有一个我想最初隐藏的标题,直到用户滚动 tableview。我的问题是当视图加载时,1 秒钟你可以看到 tableview 向上移动。我不想看到这个动作。我怎样才能正确地做到这一点?
这是我的代码:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self performSelector:@selector(hideSearchBar) withObject:nil afterDelay:0.0f];
}
- (void)hideSearchBar
{
self.tblView.contentOffset = CGPointMake(0, 40);
}