KeyboardDidShow 和 KeyboardWillShow 的区别
我有一个问题。 keyboardDidShow
和 keyboardWillShow
之间有什么区别?如果我将其放入我的 viewDidLoad
中:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidShow:)
name:UIKeyboardDidShowNotification
object:nil];
这意味着什么?抱歉,如果这是一个简单的问题,但我不确定。如果我启用视图旋转,则 keyboardDidShow
会被调用两次。
另一个问题:keyboardWillHide?它的功能是什么?
谢谢
I have a question. What is the difference between keyboardDidShow
and keyboardWillShow
? If I put this in my viewDidLoad
:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidShow:)
name:UIKeyboardDidShowNotification
object:nil];
What does it mean? Sorry if this is a simple question, but I am not sure. If I enable the rotation of my view, then keyboardDidShow
is called twice.
Another question: keyboardWillHide?
What is its functionality?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
keyboardWillShow
在键盘出现之前触发,keyboardDidShow
在键盘出现之后触发。KeyboardWillHide
在键盘消失之前触发。keyboardWillShow
is fired before the keyboard appears,keyboardDidShow
is fired afterwards.KeyboardWillHide
is fired before the keyboard disappears.