如何在 iOS8 的横向模式下启用像 iMessages/FB Messe

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 这样的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在 iOS8 的横向模式下启用像 iMessages/FB Messe

基础教程推荐