ios - Disable a button when the keyboard is popped up -
I have got a UITFFIELD, when you click on it, a keyboard will pop up; I use UITFFIELD And now when I pop up the keyboard, I want to disable a button. How can I do this?
To disable the button: You can add your code to Enable: UIKeyboardWillHideNotification object: zero]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (KeyboardWlash) Name: UIKeyboardWillShowNotification Object: Zero]; } hide the show and hide the method Finally remove the supervisor, when the class is dealloc [self.howButton setEnabled: NO]; But where do I keep it?
notifacticon , when it is shown , Then disable the button,
- (zero) init {[NSNotificationCenter defaultCenter] addObserver: auto selector: @selector (keyboardWillHide) button in init to add name
- (zero) keyboardHallHide {{self.how button is set to enable: Yes]; } - (zero) keyboard hollows {{self.howButton setEnabled: NO]; }
- delete (deleoc) dealloc {[NSNotificationCenter defaultCenter]; observer: self]; }
Comments
Post a Comment