;

キーボードの出し入れ

 [textField becomeFirstResponder];
 [textField resignFirstResponder];

iPhoneのキーボードのカスタマイズ


キーボードの出し入れの変化の通知

UIKeyboardDidShowNotification
UIKeyboardDidHideNotification

登録方法
[[NSNotificationCenter defaultCenter] addObserver:self
           selector:@selector(keyboardShowed:)
           name:UIKeyboardDidShowNotification object:nil];
情報
 NSDictionary* info = [aNotification userInfo];

入ってる情報
 NSString *const UIKeyboardFrameBeginUserInfoKey; //キーボードのframeの入ったNSValueがとれる
 NSString *const UIKeyboardFrameEndUserInfoKey; //frameがとれる
 NSString *const UIKeyboardAnimationDurationUserInfoKey;
 NSString *const UIKeyboardAnimationCurveUserInfoKey;


UITextField デリゲート

-(BOOL)textFieldShouldBeginEditing:(UITextField*)textField
-(BOOL)textFieldShouldEndEditing:(UITextField*)textField
-(void)textFieldDidBeginEditing:(UITextField*)textField
-(void)textFieldDidEndEditing:(UITextField*)textField
-(BOOL)textFieldShouldReturn:(UITextField*)textField
-(BOOL)textFieldShouldClear:(UITextField*)textField

UIControl関連



最終更新:2012年03月01日 17:57