如何在 iOS8 的横向模式下启用像 iMessages/FB Messenger 这样的键盘?

How can one enable keyboard like in iMessages/FB Messenger in landscape mode at iOS8?(如何在 iOS8 的横向模式下启用像 iMessages/FB Messenger 这样的键盘?)
本文介绍了如何在 iOS8 的横向模式下启用像 iMessages/FB Messenger 这样的键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在我的项目中,我有带有关联输入键盘的 textViews,它在 iOS8 下的 iPhone 6 Plus 上的横向模式下看起来很奇怪,如下所示:

In my project I have textViews with associated input keyboard which has the strange look in landscape mode on iPhone 6 Plus under iOS8 as shown below:

它内部有时似乎有不同的方向.

It seems that it has different orientation internally sometimes.

但在某些情况下,键盘可以很好地旋转,但在方向更改和其他可见错误期间仍然存在白色间隙:

But in some cases keyboard rotates fine but still has white gaps during orientation change and other visible bugs:

最后我们有了普通的扩展横向视图:

and finally we have ordinary expanded landscape view:

问题是如何获得没有错误的扩展键盘,如下所示:

The question is how one can get the extended keyboard without bugs as follows:

推荐答案

将项目从 xCode5.1(及更早版本)迁移到 xCode6 时要做的非常重要的事情就是修改Info.plist文件,增加Launch screen interface file base name

The very important thing to do while migrating projects from xCode5.1 (and earlier) to xCode6 is to modify Info.plist file by adding Launch screen interface file base name key

您可以将其设置为空字符串(通常是 Launch xib 的名称).如果没有这个简单的第一行,就会出现上面截图中出现的所有问题.

You can event set it to empty string (usually it is a name of the Launch xib). Without this simply line one will have all the problems presented at screenshots above.

启动屏幕界面文件基本名称 的缺失会导致在兼容模式下使用旧设备的标准分辨率.让我们在每种情况下在项目中运行以下代码

The absence of the Launch screen interface file base name results in working in compatibility mode with standard resolution of older devices. Let's run the following code in the project in each case

NSLog(@"bounds = %@", NSStringFromCGRect(UIScreen.mainScreen.bounds));

使用 Launch xib 一个得到

bounds = {{0, 0}, {414, 736}} // for iPhone 6Plus

bounds = {{0, 0}, {375, 667}} // for iPhone 6

没有它一个人得到

bounds = {{0, 0}, {320, 568}}

所以,最后一种情况确实是兼容模式.

So, the last case indeed is the compatibility mode.

这篇关于如何在 iOS8 的横向模式下启用像 iMessages/FB Messenger 这样的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

No resource found that matches the given name: attr #39;android:keyboardNavigationCluster#39;. when updating to Support Library 26.0.0(找不到与给定名称匹配的资源:attr android:keyboardNavigationCluster.更新到支持库 26.0.0 时) - IT屋-程序员软
How to resize UITextView on iOS when a keyboard appears?(出现键盘时如何在iOS上调整UITextView的大小?)
How to reliably detect if an external keyboard is connected on iOS 9?(如何可靠地检测 iOS 9 上是否连接了外部键盘?)
How to mimic Keyboard animation on iOS 7 to add quot;Donequot; button to numeric keyboard?(如何在 iOS 7 上模拟键盘动画以添加“完成数字键盘的按钮?)
How do I dismiss the iOS keyboard?(如何关闭 iOS 键盘?)
Is possible to simulate touch event using an external keyboard on ios jailbroken?(是否可以在 ios 越狱后使用外部键盘模拟触摸事件?)