将故事板从 iPhone 转换为 iPad [英] Converting Storyboard from iPhone to iPad
问题描述
我有一个带有故事板的 iPhone
应用程序.现在我也想提供一个 iPad
应用程序.所以我问我是否有一个功能可以帮助我将我的 iPhone
故事板转换为 iPad
故事板.
I have an iPhone
application which has a storyboard. Now I want to provide an iPad
application too. So I asked me whether there is a function which helps me convert my iPhone
storyboard to an iPad
storyboard.
具体来说:
有类似的功能还是只有手动方式?
推荐答案
我找到了一种解决方案:
I found out a kind of solution:
复制你的 iPhone-Storyboard 并重命名它
MainStoryboard_iPad.storyboard
关闭 Xcode,然后在任何文本编辑器中打开此文件.
Close Xcode and then open this file any text editor.
搜索 targetRuntime="iOS.CocoaTouch"
并将其更改为 targetRuntime="iOS.CocoaTouch.iPad"
Search for targetRuntime="iOS.CocoaTouch"
and change it to targetRuntime="iOS.CocoaTouch.iPad"
将 MainStoryboard_iPad.storyboard 中的代码更改为:
Change the code in the MainStoryboard_iPad.storyboard from:
to
现在保存所有内容并重新打开 Xcode.iPad-Storyboard 的内容与 iPhone 文件相同,但所有内容都可能被打乱.
Now save everything and reopen Xcode. The iPad-Storyboard has the same contents as the iPhone-file but everyting could be disarranged.
这节省了我几个小时 - 希望这会帮助你
This saved me hours - hopefully this will help you
这篇关于将故事板从 iPhone 转换为 iPad的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!