[英]How to get rid of space between UITextField and Keyboard
I was wondering if anyone has seen a similar problem to this where you have a random blank space between the keyboard and a UITextField? 我想知道是否有人看到过类似的问题,您在键盘和UITextField之间有一个随机的空格? For some reason I can't find anything about this and the end of the screen is the bottom of the UITextField.
由于某种原因,我对此一无所获,屏幕的结尾是UITextField的底部。 Any help would be greatly appreciated.
任何帮助将不胜感激。
Example Screenshot showing space between keyboard and UITextField 屏幕截图示例显示了键盘和UITextField之间的空间
UIScrollView
. UIScrollView
。 UIKeyboardDidShowNotification
. UIKeyboardDidShowNotification
。 This notification will give you a dictionary that has the size of the keyboard. contentInset
to be such that the text field is just above it. contentInset
要的contentInset
,以使文本字段位于其上方。 Here's an example for getting the size of the keyboard: How to get UIKeyboard size with Apple iPhone SDK 这是获取键盘大小的示例: 如何使用Apple iPhone SDK获取UIKeyboard大小
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.