Objective C - One storyboard for iPad and iPhone

谁说胖子不能爱 提交于 2019-12-18 15:57:22

问题


I just want to know if it is possible for an iPad and iPhone application to share the same storyboard?

I currently have 2 storyboards, one for iPad and one for iPhone. Is it possible to have both devices running form the same storyboard?

Regards, EZFrag


回答1:


If your iPhone and iPad has same views, then this is possible, the views you create in your iPhone will stretch to fill the iPad screen, however this is not recommended since iPad has bigger screen you should create different views with different view arrangements and structure for both the iPad and the iPhone

To set the same story board for the iPad and iPhone check the screen shot




回答2:


Using the XCode6 Size Classes you can officially have the same Storyboard used for both the iPhone (all resolutions) and the iPad, saving you from keeping two files up to date. The resulting storyboard is compatible with iOS7+.

Read more about this here: https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/AboutAdaptiveSizeDesign.html#//apple_ref/doc/uid/TP40014436-CH6-SW1 Use size classes to enable a storyboard or xib file to work with all available screen sizes. This enables the user interface of your app to work on any iOS device.



来源:https://stackoverflow.com/questions/11155038/objective-c-one-storyboard-for-ipad-and-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!