iphone storyboard 转为ipad storyboard

写了一个iphone的程序,storyboard是iphone的,如果想将程序转为ipad的storyboard也支持。需要做一下几个步骤

1、选中storyboard文件,假设名字为MainStoryboard.storyboard

2、File--->duplicate,将文件命名为MainStoryboard_ipad.storyboard

3、在plist文件中添加两项,Main storyboard file base name (iPhone)和Main storyboard file base name (iPad),其值分别对应1和2的两个storyboard

4、右键MainStoryboard_ipad.storyboard,open as ---> source code,找到targetRuntime,将其修改为targetRuntime="iOS.CocoaTouch.iPad"

5、最后一步,选中项目-----> targets----->summary(不是bulid settings页),将devices改为universal

运行你的程序,分别选中iphone和ipad simulator,对应的是不同的storyboard。

 

猜你喜欢

转载自zhong871004.iteye.com/blog/1721941