1
我有一個動作,允許我提出一個ModalViewController並顯示UITextField作爲第一個響應者,問題是當這個ModalViewController會出現它需要一點時間,原因是鍵盤,當我抓住代碼viewDidAppear鍵盤需要一點時間才能顯示出來,所以我怎麼才能讓UIViewController快速出現?鍵盤使UIView緩慢出現時?
- (IBAction)goToModalViewController
{
ModalSearchViewController *msvc = [[ModalSearchViewController alloc] init];
self.msvc.context = context;
self.msvc.delegate = self;
[self.msvc setModalTransitionStyle:UIModalTransitionStyleCrossDissolve ];
[self presentModalViewController:msvc animated:YES];
}
的ModalViewController的viewWillAppear中:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
[findTextField becomeFirstResponder];
}
您可以更改延遲取決於您希望延遲多少時間。 – Ilanchezhian 2012-01-05 06:34:33