简体   繁体   English

从通用更改为仅iPhone后,iPhone应用程序无法在iPad上正常工作

[英]iPhone app does not work correctly on iPad after change from universal to iphone only

How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'? 将目标从最初的“通用”更改为“ iPhone”后,如何在iPad上运行iPhone应用程序?

I'm working on a game for iOS (iPhone) using Swift and SpriteKit. 我正在使用Swift和SpriteKit开发适用于iOS(iPhone)的游戏。 The game got rejected today for this reason: 今天,游戏因以下原因而被拒绝:

Reasons for Rejection: 2.10: iPhone apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution 拒绝原因:2.10:iPhone应用程序还必须在iPad上运行且未经修改,并且必须达到iPhone分辨率和2X iPhone 3GS分辨率。

After searching on StackOverflow I found out that it might have something to do with my info.plist file because at first my app was 'universal' and later I've changed it to iPhone-only. 在StackOverflow上搜索后,我发现它可能与info.plist文件有关,因为起初我的应用程序是“通用的”,后来我将其更改为仅iPhone。

It seems like there's something wrong with the aspect ratio of all the nodes. 所有节点的长宽比似乎有问题。 Take a look at the screenshots below. 看看下面的截图。 At the left side is the iPad-simulator and on the right there's the iPhone-simulator. 左边是iPad模拟器,右边是iPhone模拟器。

Maybe the game still thinks it is running on iPad because the nodes appear in 4:3 ratio? 也许游戏仍然认为它在iPad上运行是因为节点以4:3的比例出现?

How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'? 将目标从最初的“通用”更改为“ iPhone”后,如何在iPad上运行iPhone应用程序?

Please help. 请帮忙。 Thanks! 谢谢!

在此处输入图片说明

I've also added a screenshot of my info.plist file. 我还添加了info.plist文件的屏幕截图。

在此处输入图片说明

Apple requires that each app targeted on iPhone should run on iPad in the specific manner. 苹果要求针对iPhone的每个应用都应以特定方式在iPad上运行。

This usually looks like the app on iPad is not full-screen, it's surrounded by black frame that resembles the situation that the iPad is simulating iPhone. 这通常看起来像iPad上的应用程序不是全屏的,它被黑框包围,类似于iPad在模拟iPhone的情况。

My suggestion is to use size class now to make the app run full-screen on iPad and this should fix your issue with Apple. 我的建议是立即使用size类使该应用程序在iPad上全屏运行,这应该可以解决Apple问题。

Simply choose in your storyboard Regular Width and Regular Height, delete the existing constraints and set new ones. 只需在情节提要中选择“常规宽度”和“常规高度”,删除现有约束并设置新约束即可。

More help here and apple docs also might come in handy 此处提供更多帮助, 苹果文档也可能派上用场

Darvydas' comment solved my problem. 达维达斯的评论解决了我的问题。

What size does your background node have? 您的背景节点有多大? Also if you whant your app run only on Landscape delete those 2 (Item 0, Item 1 PORTRAIT) 另外,如果您希望应用仅在Landscape上运行,请删除这2个(Item 0,Item 1 PORTRAIT)

在此处输入图片说明

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

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