私はこのようなものを実装する必要があります:
tableViewはバウンスする必要がありますが、ナビゲーションバーはバウンスできません。
さまざまなバリエーションを試しました。このようなもの:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGRect imageViewFrame = self.imageView.frame;
CGRect tableViewFrame = self.tableView.frame;
//ImageView - is top view(instead of NavBar)
//defaultHeight - is default height of tableView
imageViewFrame.origin.y = MIN(0, MAX(-scrollView.contentOffset.y, -100));
tableViewFrame.origin.y = imageViewFrame.origin.y + 100;
tableViewFrame.size.height = defaultHeight - imageViewFrame.origin.y;
self.imageView.frame = imageViewFrame;
self.tableView.frame = tableViewFrame;
}
これを取れ:
InstagramではtableViewのサイズが変わらないため、適切ではありません(スクロールインジケーターを見てください。tableViewのサイズが変更された場合は、それらも変更されます)
また、ViewをsubViewとしてtableViewに追加しようとしましたが、機能しますが、正確には必要なものではありません。tableViewの外にあるInstagramのナビゲーションバーでは、それも適していません。
Facebookアプリでは、検索バーはまったく同じように動作します
誰か助けてもらえますか?
ありがとう!