简体   繁体   English

XCode 8:如何为 iPAD 调整 iphone 应用程序

[英]XCode 8: how to adapt iphone app for iPAD

Even if my client made me design an iOS app only for iphone devices, now he wants me to run it in iPADS too, as a preview before loading the app in the App Store (ipads 2 or 3).即使我的客户让我设计一个仅适用于 iphone 设备的 iOS 应用程序,现在他也希望我在 iPADS 中运行它,作为在 App Store(ipads 2 或 3)中加载应用程序之前的预览。 My app has many constraints so that it's showed good on any kind of iphone (> 5S).我的应用程序有很多限制,因此它在任何类型的 iphone (> 5S) 上都显示良好。 So, I set the "Targeted Device Family" to "1,2" in the info.plist of the app and I tried to install it in a pair of iPADs.因此,我在应用程序的 info.plist 中将“目标设备系列”设置为“1,2”,并尝试将其安装在一对 iPAD 中。 Even if in iphone eberything is good like the following:即使在 iphone 中 eberything 也像下面这样: 在此处输入图片说明

the same thing does not happen in the ipad:在 ipad 中不会发生同样的事情:

I do not understand why everything is so magnified and not full-screen.我不明白为什么一切都被放大而不是全屏。 What can I do just to fix this a little?我能做些什么来解决这个问题?

在此处输入图片说明

This is what I see in info.plist --> Build Settings这是我在 info.plist --> 构建设置中看到的

在此处输入图片说明

Set rather this value in your Target -> General settings:在您的目标 -> 常规设置中设置此值:

在此处输入图片说明

My app is working properly on the iPad even with Target Device Family set to 1.即使目标设备系列设置为 1,我的应用程序也能在 iPad 上正常运行。

在此处输入图片说明

Add key "UIRequiresFullScreen" and set Yes to your info.plist file添加键“UIRequiresFullScreen”并将是您的 info.plist 文件在此处输入图片说明

I found these steps handy when you want your iPhone app to adapt for iPad -当你想让你的iPhone 应用程序适应 iPad时,我发现这些步骤很方便 -

  1. Testing the complete app first首先测试完整的应用程序
  2. All screens design need to check for eg.所有屏幕设计都需要检查,例如。 Button or Images width and height as per iPad screen iPad 屏幕上的按钮或图像宽度和高度
  3. Create different versions of XIBs for particular screens为特定屏幕创建不同版本的 XIB
  4. Check if all images are in right resolutions检查所有图像的分辨率是否正确
  5. Handle auto-sizing and orientation处理自动调整大小和方向
  6. Find how and when to use the new iPad elements like split view controller, popover view controller, and popover list了解如何以及何时使用新的 iPad 元素,例如拆分视图控制器、弹出视图控制器和弹出列表
  7. An important tip - Be really careful never to have two popover controllers visible at the same time – it's confusing to users and your app will get rejected if you do一个重要提示 - 千万不要让两个 popover 控制器同时可见 - 这会让用户感到困惑,如果你这样做,你的应用程序将被拒绝

on XCode 12, you have to look for Targets -> General Tab...在 XCode 12 上,你必须寻找 Targets -> General Tab...

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM