
- (voID) keyboarDWasShown:(NSNotification *)nsNotification { NSDictionary *userInfo = [nsNotification userInfo]; CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; NSLog(@"Height: %f WIDth: %f",kbSize.height,kbSize.wIDth); // Portrait: Height: 264.000000 WIDth: 768.000000 // Landscape: Height: 1024.000000 WIDth: 352.000000} 怎么键盘的高度可以是1024?这意味着键盘现在覆盖整个屏幕.我认为高度应该是352,宽度应该是1024.这是一个错误吗?
解决方法 从 http://developer.apple.com/library/ios/documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html#//apple_ref/doc/uid/TP40006817-CH3-SW27起总结UIKeyboardFrameBeginUserInfoKey
The key for an NSValue object containing a CGRect that IDentifIEs the start frame of the keyboard in screen coordinates. These coordinates do not take into account any rotation factors applIEd to the window’s contents as a result of interface orIEntation changes. Thus,you may need to convert the rectangle to window coordinates (using the convertRect:fromWindow: method) or to vIEw coordinates (using the convertRect:fromVIEw: method) before using it.
以上是内存溢出为你收集整理的ios – 在横向模式下,为什么iPad键盘高度为1024px?全部内容,希望文章能够帮你解决ios – 在横向模式下,为什么iPad键盘高度为1024px?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)