如何在iOS8的横向模式下启用iMessages / FB Messenger中的键盘? [英] How can one enable keyboard like in iMessages/FB Messenger in landscape mode at iOS8?

查看:265
本文介绍了如何在iOS8的横向模式下启用iMessages / FB Messenger中的键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有带有相关输入键盘的textViews,它在iOS6下的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 文件 key

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

您可以将事件设置为空字符串(通常是启动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));

使用启动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中的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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