简体   繁体   English

使Universal(iPhone + iPad)应用程序在iPad上的iPhone故事板上运行(模拟大小)

[英]Make Universal (iPhone+iPad) app run on iPhone storyboard on iPad (simulated size)

I have a universal app that I've previously designed for both iPhone and iPad, now I don't want to work with the iPad storyboard. 我有一个以前为iPhone和iPad设计的通用应用程序,现在我不想使用iPad故事板。 I know that I can't withdraw iPad support as I've previously published the app as universal. 我知道我无法撤消对iPad的支持,因为我之前已将其发布为通用应用程序。 I need to keep my app "Universal" (so that I can update my app without failing verification), but make iPad use the iPhone storyboard in simulation mode. 我需要使我的应用程序保持“通用”状态(以便我可以更新应用程序而不会通过验证),但要让iPad在模拟模式下使用iPhone故事板。 How can I use my iPhone storyboard with iPad in simulation mode? 如何在模拟模式下将iPhone Storyboard与iPad一起使用? I've deleted the iPad storyboard, and changed the main interface of iPad also to the iPhone storyboard, but now iPad stretches all the view constraints to 768x1024 to fill the screen, giving it an ugly look. 我删除了iPad情节提要,并将iPad的主界面也更改为iPhone情节提要,但是现在iPad会将所有视图限制扩展到768x1024以填充屏幕,从而使外观看起来很丑陋。 I just want to simulate the "iPhone app" (with the 2x button at the corner) but for obvious reasons, I need to keep device mode in "Universal" in project settings. 我只想模拟“ iPhone应用程序”(位于角落的2x按钮),但是出于明显的原因,我需要在项目设置中将设备模式保持在“通用”状态。 If it's not possible, what is the best practice to programatically limit the whole storyboard to some limited size on the screen to manually make my app run at the same size (or double) of iPhone? 如果不可能,则最好的做法是通过编程将整个故事板限制为屏幕上的有限大小,以手动使我的应用程序以相同(或两倍)iPhone的大小运行?

You can't do what you are asking. 你不能做什么。 Once an app is universal it stays universal. 一旦应用程序成为通用应用程序,它将保持通用性。 You can't suddenly make the app appear to be iPhone-sized on the iPad. 您不能突然使该应用在iPad上看起来像iPhone大小。 The universal app on the iPad will always be full screen. iPad上的通用应用程序将始终为全屏。 You need to continue properly supported the iPad screen size. 您需要继续正确支持iPad的屏幕尺寸。

Your only other solution is to create a new iPhone-only app with a new bundle id. 您唯一的其他解决方案是使用新的捆绑包ID创建仅iPhone的新应用程序。 Of course this is bad for your existing users. 当然,这对您现有的用户不利。

When you make your app only for iPhone and run it on iPad, there will be 2x scaling button. 当您只为iPhone制作应用程序并在iPad上运行时,将有2倍缩放按钮。 If you make your app universal, then your view will be stretched on iPad unless you use constraints, or create your screens programmatically regarding iPad and iPhone UI element sizes. 如果使您的应用程序具有通用性,则除非使用约束,否则将在iPad上扩展视图,或者以编程方式创建有关iPad和iPhone UI元素大小的屏幕。

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

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