开发者

ios eiditing a table, keyboard hide the field

开发者 https://www.devze.com 2023-02-08 23:00 出处:网络
I have this problem.. I have a view that contains a uitableview with each column is on a different row (i开发者_高级运维s to editing a row, like the address book for example)

I have this problem.. I have a view that contains a uitableview with each column is on a different row (i开发者_高级运维s to editing a row, like the address book for example) everything is ok, but if I click on the last field on the bottom, the keyboard appears, but appear over the field and I can't see nothing....

how can I solve this thing?

thanks in advance


  1. You may need to know whether the keyboard is showing up or not.

  2. Register for a few notifications:

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillShow:)
                                                 name:UIKeyboardWillShowNotification object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWasShown:)
                                                 name:UIKeyboardDidShowNotification object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillHide:)
                                                 name:UIKeyboardWillHideNotification object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWasHidden:)
                                                 name:UIKeyboardDidHideNotification object:nil];
    
  3. Scroll the row in tableview to a visible position in the listeners: keyboardWillShow keyboardWasShown keyboardWillHide keyboardWasHidden.

0

精彩评论

暂无评论...
验证码 换一张
取 消