简体   繁体   English

如何使我的iPhone应用程序在iPad上运行?

[英]How to make my iphone app work on an iPad?

It is my understanding (i have seen it) that some apps can be opened and viewed in an iPad. 据我了解(我已经看到),某些应用程序可以在iPad中打开和查看。 Although, the iPad keeps the screen small, or pixelated if doubled the screen size. 不过,iPad会保持屏幕较小,如果屏幕尺寸增加一倍,则像素化。

I am attempting to do the same thing with my app, however when I attempt to run it on an iPad it crashes with the error 我正在尝试对我的应用执行相同的操作,但是当我尝试在iPad上运行该应用时,它会因错误而崩溃

'Could not find a storyboard named 'MainStoryboard_iPad' “找不到名为“ MainStoryboard_iPad”的情节提要

This is obvious, as I do no have a storyboard for the iPad, but currently I don't want one. 这很明显,因为我没有iPad的演示图板,但目前我不希望使用此脚本。 I just want the iPad to run the app as an iPhone app in a smaller version. 我只希望iPad在较小版本中作为iPhone应用程序运行。 So my question is, how do I stop it from looking for the iPad storyboard? 所以我的问题是,如何阻止它寻找iPad故事板? Its my understanding I must adjust something in the plist.info but I don't know how to access that in xcode. 据我了解,我必须调整plist.info中的内容,但是我不知道如何在xcode中访问它。 its my understanding you select the project in the navigator then select 'info' but I don't see any information that people say should be in the plist.info. 据我了解,您可以在导航器中选择项目,然后选择“信息”,但我看不到人们说应该在plist.info中的任何信息。

Thanks 谢谢

You seem to have made your application universal. 您似乎已经使您的应用程序具有通用性。 You want to set your "devices" to iPhone. 您想要将“设备”设置为iPhone。 This can be done on the target summary page (No need to interact with your .plist directly). 这可以在目标摘要页面上完成(无需直接与.plist交互)。

在此处输入图片说明

Only target iPhone platform, and do not call any iPad interface objects in your code. 仅以iPhone平台为目标,请勿在代码中调用任何iPad接口对象。 You should look in your Main xib file to make sure there are no references to an iPad interface object. 您应该在Main xib文件中查找,以确保没有对iPad接口对象的引用。

iPhone only apps should natively run in double-pixel mode. 仅iPhone的应用程序应本机以双像素模式运行。 In order to resolve the pixelated / grainy issue you see, use @2x (for iPhone) size images. 为了解决您看到的像素化/颗粒状问题,请使用@ 2x(对于iPhone)尺寸的图像。 This will reduce the pixelation you see, but will still contain some. 这将减少您看到的像素,但仍会包含一些像素。

Ok, I found the final issue. 好的,我找到了最后一个问题。 After editing the summary to 'iPhone' I also had to go into the Info tab and change the line that says 将摘要编辑为“ iPhone”后,我还必须进入“信息”标签并更改显示以下内容的行

'Main storyboard file base name (iPad) to MainStoryboard_iPhone. “主故事板文件的基本名称(iPad)为MainStoryboard_iPhone。 It was currently set to MainStoryboard_iPad. 当前设置为MainStoryboard_iPad。 That second step fixed the issue. 第二步解决了这个问题。

Thanks guys! 多谢你们!

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

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