How can one enable keyboard like in iMessages/FB Messenger in landscape mode at iOS8?

后端 未结 2 1028
猫巷女王i
猫巷女王i 2020-12-09 14:05

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:

2条回答
  •  悲&欢浪女
    2020-12-09 14:49

    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

    enter image description here

    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));
    

    With Launch xib one gets

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

    Without it one gets

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

    So, the last case indeed is the compatibility mode.

提交回复
热议问题