왜 그런지 궁금하고 해결할 필요가 있습니다. 이 검색 창은 이렇게 보입니다. searchDisplayControllerWillEnd 검색 창의 크기를 조정하지 않음
클릭하면 위쪽으로 이동하여 검색 창 높이가 0,0,320입니다. 이 33,55,270, 검색 창 높이로 다시 크기를 조정해야 취소를 클릭
. 하지만 그렇지 않은searchDisplayControllerDidEndSearch 다시 크기를 조정하기 위해 노력할 것, 그러나 사용자가 변경 사항을 볼 수있는 1 초 지연이 있습니다. 어떤 몸이라도 searchDisplayControllerWillEndSearch에서 애니메이션의 크기를 변경하면 작동하지 않습니다.
의견과 피드백에 감사드립니다.
- (void) searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller
{
[UIView animateWithDuration:.1
animations:^{
controller.searchResultsTableView.frame = frogTableView.frame;
searchDisplayController.searchResultsTableView.frame = frogTableView.frame;
searchDisplayController.searchBar.frame = CGRectMake(32,
55,
270,
searchDisplayController.searchBar.frame.size.height);
searchBar.frame = CGRectMake(32,
55,
270,
searchBar.frame.size.height);
frogTableView.frame = CGRectMake(frogTableView.frame.origin.x,
121,
frogTableView.frame.size.width,
frogTableView.frame.size.height);
notePad.frame = CGRectMake(notePad.frame.origin.x,
45,
notePad.frame.size.width,
notePad.frame.size.height);
searchDisplayController.searchResultsTableView.frame = frogTableView.frame;
}
completion:^(BOOL finished){
//whatever else you may need to do
}];
}
Ooohhh, 왜 블록? 일반적으로 GCD 또는 복잡한 네트워킹과 같은 경우에만 사용해야합니다. 당신은 그것을 과용하고 있습니다 : P –
그래서 Galaxas0를 어떻게해야합니까? – Desmond
가능한 속임수 - http://stackoverflow.com/questions/556814/changing-the-size-of-theisearchbar-textfield – rishi