UIKeyboardFrameBeginUserInfoKey/UIKeyboardFrameEndUserInfoKey:有何区别? [英] UIKeyboardFrameBeginUserInfoKey/UIKeyboardFrameEndUserInfoKey: what is the difference?

查看:235
本文介绍了UIKeyboardFrameBeginUserInfoKey/UIKeyboardFrameEndUserInfoKey:有何区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在Apple文档中阅读以下内容:

It is possible to read the following in the apple Documentation:

UIKeyboardFrameBeginUserInfoKey 包含CGRect的NSValue对象的键,它标识键盘的起始帧……

UIKeyboardFrameBeginUserInfoKey The key for an NSValue object containing a CGRect that identifies the start frame of the keyboard ……

UIKeyboardFrameEndUserInfoKey 包含CGRect的NSValue对象的键,该CGRect标识键盘的末端框架……

UIKeyboardFrameEndUserInfoKey The key for an NSValue object containing a CGRect that identifies the end frame of the keyboard ……

这是否意味着键盘具有开始帧"和结束帧"? 我想是的.

Would that mean that the keyboard has a "start frame" and an "end frame"? I suppose YES.

但是当键盘出现时,我看不到任何帧变化.从头到尾都保持不变.

But when the keyboard appears I cannot see any frame changing. It just stays the same frome start to end.

所以我的问题是: 那些开始帧"和结束帧"指的是什么? 我一定想念一些东西.

So my question is: What are those "start frame" and "end frame" referring to? I must be missing something.

感谢您的帮助.

推荐答案

键盘的确有一个开始和结束帧,并且这些属性确实可以实现您期望的功能.但是,它们的键盘并不总是动画.有时它只是出现或改变大小.例如,在日语键盘上键入的情况下,当在第一个字符被击中后keyboardWillShow触发时.没有动画,但是键盘上方显示了一个附加栏,从而更改了大小.上面列出的属性告诉您键盘改变大小的程度.

The keyboard does indeed have a start and end frame, and the properties do exactly what you suppose they do. They keyboard does not always animate however; sometimes it just appears or changes size. For example, in the case that you are typing on the Japanese keyboard, when the keyboardWillShow fires after the first character is hit. There's no animation, but an additional bar appears above the keyboard, thus changing the size. The properties you listed above tell you how much the keyboard changed size by.

我不确定当您说帧没有变化时您到底在看什么.我想当您从一个可编辑的文本字段移到另一个时,即使屏幕上没有任何变化,您也会收到keyboardWillShow通知.

I'm not sure what exactly you're looking at when you say no frames are changing. I suppose it's possible that when you move from one editable text field to another, you get a keyboardWillShow notification, even though nothing on the screen changes.

这篇关于UIKeyboardFrameBeginUserInfoKey/UIKeyboardFrameEndUserInfoKey:有何区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆