简体   繁体   English

iOS:测试iPad中iPhone的应用程序,屏幕尺寸

[英]iOS: test app for iPhone in iPad, screen size

我有一个愚蠢的问题:为什么当我在iPad上调试iPhone的应用程序时,模拟在iPhone 4屏幕而不是其他类型的屏幕上开始?

If I understand you correct, please use this button to choose which one you want to use in simulator : 如果我了解您正确的话,请使用此按钮选择要在模拟器中使用的按钮:

在此处输入图片说明

when you click you should able to see some list like this : 当您单击时,您应该能够看到如下列表:

在此处输入图片说明

If you're not able to see other iOS version you can add them in Xcode/Preferences/Downloads section : 如果看不到其他iOS版本,则可以在Xcode / Preferences / Downloads部分中添加它们:

在此处输入图片说明

please let me not if you're not asking this. 如果您不问这个,请不要让我。

To set the App to work on a different size screen you must add that screen size to the LaunchImage asset. 若要将应用程序设置为在其他尺寸的屏幕上运行,您必须将该屏幕尺寸添加到LaunchImage资产中。

1) Create an splash screen launch image for the size of the iPad you want to use. 1)创建一个要使用的iPad尺寸的启动屏幕启动图像。

2) Import it into your project 2)将其导入您的项目

3) Open images.xcassets in the Project Navigator 3)在项目浏览器中打开images.xcassets

在此处输入图片说明

4) Select LaunchImage 4)选择启动图像

5) Drag and drop the splash screen launch image to the correct iPad asset 5)将启动屏幕启动图像拖放到正确的iPad资产上

在此处输入图片说明

It is very frustrating and seems strange, but the Launch Image size tells the App what dimension it can run on. 这非常令人沮丧,而且看起来很奇怪,但是启动图像的大小告诉应用程序可以在什么尺寸上运行。 Setting image sizes in your screen or using auto layout won't work unless that Launch Image size has a splash screen 除非“启动图像”尺寸具有启动画面,否则无法在屏幕上设置图像尺寸或使用自动布局

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

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