さまざまなエントリを持つTableViewがあります。下にスクロールする必要がある場合もあれば、エントリが少ない場合もあるため、すべてが表示されます。
最初のセルにいくつかの設定とフィルターが必要ですが、ユーザーが下にスクロールしたときにのみ表示されないようにする必要があります。
私の試み:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
float rowHeight = [self tableView:self.tableView heightForRowAtIndexPath:indexPath];
self.tableView.contentOffset = CGPointMake(0, rowHeight);
}
と
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTopanimated:NO];
}
両方とも機能しませんでした。
私の問題について何かアドバイスはありますか?