2016-10-22 6 views
0

基本的に、ナビゲーションバーの下に2つのボタンが含まれています。これらの2つのボタンの下には、UITableViewがあり、そのヘッダビューにはUISearchBarがあります。しかし、検索バーをクリックすると、アニメーションが非常に奇妙に動きます。 After adding animations to the tableview frameUISearchBarをカスタムUITableviewに入れて奇妙なアニメーションを引き起こす

それから私は、アニメーションはこのAfter adding animations to the tableview frame

ようになり、テーブルビューに追加コードは次のようである

After adding animations to the tableview frame

、上部に検索バーと一緒のUITableViewを移動するアニメーションを使用してみてくださいこれは:

UISearchBarをwholと共に画面の上部に移動する方法が不思議ですeテーブルビューと滑らかなアニメーション。

+0

このコードを試してみてください。質問は明確ではない(少なくとも私にとって)。 –

答えて

0
- (BOOL) searchBarShouldBeginEditing:(UISearchBar *)searchBar { 
    [UIView animateWithDuration:0.1 
         animations:^{ 
          [ searchBar setFrame:CGRectMake(searchBar.frame.origin.x, 0, searchBar.frame.size.width, searchBar.frame.size.height)]; 
          [self.myTableView setFrame:CGRectMake(myTableView.frame.origin.x, searchBar.frame.size.height, self.myTableView.frame.size.width, myTableView.frame.size.height)]; 
         } 
         completion:nil]; 

    return YES; 
} 

は、あなたが他のスクリーンショットを含める場合、それが役立つだろう

関連する問題