开发者

How not to dismiss keyboard in iPad even if the user presses the dismiss button on the right bottom?

开发者 https://www.devze.com 2023-03-13 13:55 出处:网络
On one of my view controllers on iPad, I don\'t want the user to dismiss the keyboard even if the user presses the dismiss button on the right bottom of the keyboard. I want this because there\'s noth

On one of my view controllers on iPad, I don't want the user to dismiss the keyboard even if the user presses the dismiss button on the right bottom of the keyboard. I want this because there's nothing else on the view that he 开发者_开发百科can do without the keyboard and the button below the textfields, and the view looks empty without the keyboard.

I've tried listening to keyboardWillHide notification and making one of my text fields the first responder on the callback method but it didn't work. I've tried returning NO from textFieldShouldReturn or textFieldShouldEndEditing methods but they don't produce the behavior I want, either.

Below is the screenshot of a scratch view. Do you have any other ideas?

How not to dismiss keyboard in iPad even if the user presses the dismiss button on the right bottom?


Have you tried to return NO in UITextField delegate's - (BOOL)textFieldShouldEndEditing:(UITextField *)textField ?

0

精彩评论

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

关注公众号