我有一個UIViewController,我想用serchBar顯示一個tableview。就這麼簡單:UISearchBar動畫問題
//viewDidLoad
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,
0,
SCREEN_WIDTH(),
SCREEN_HEIGHT())
style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
[self.view addSubview:_tableView];
// adding uisearch bar
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
_tableView.tableHeaderView = searchBar;
//
searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;
當我uisearch欄裏面點擊使動畫的開始和它看起來像它有一個20像素的不必要偏移
你可以加我到NSChat組嗎?還要在IB中試驗這些維度,看看問題是否仍然存在。什麼尺寸可以消除這個問題也可以從IB – aMother
推斷Im not use IB – luca
您是否在使用任何種類的動畫? @luca –