我需要在顯示鍵盤時將視圖向上移動,但僅對於視圖底部的1個文本框,我認爲這將與檢查isFirstResponder一樣簡單,但沒有這樣的運氣 - 這是我正在嘗試的:只有在ipad上點擊某個文本字段時才顯示鍵盤?
if ([notes isFirstResponder]) {
[UIView beginAnimations:@"moveupcontrols" context:nil];
[UIView setAnimationDuration:.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
self.view.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y-kOrderFormKeyboardHeight, self.view.frame.size.width, self.view.frame.size.height) ;
[UIView commitAnimations];
keyboardIsShown = YES;
}
我假設通知在我的文本字段上設置FirstResponder標誌之前觸發。關於這方面的解決方法的想法?
很好,謝謝 – Slee 2010-08-24 14:48:51