zoukankan      html  css  js  c++  java
  • Converting Storyboard from iPhone to iPad

    I found out a kind of solution:

    1. Duplicate your iPhone-Storyboard and rename it MainStoryboard_iPad.storyboard

    2. Close Xcode and then open this file any text editor.

    3. Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad"

    4. Change the code in the MainStoryboard_iPad.storyboard from: <simulatedScreenMetrics key="destination" type="retina4"/> to <simulatedScreenMetrics key="destination"/>

    5. Now save everything and reopen Xcode -> the iPad-Storyboard contains the same as the iPhone-file but everyting could be disarranged

    This saved me hours - hopefully this will help you

    After some digging through the storyboard source code, it turns out that the iPad storyboard was copied from the iPhone storyboard. So, the question really became how do I convert an iPhone storyboard into an iPad storyboard?

    The answer is surprisingly simple. I ran across this SO answer -- to convert an iPhone storyboard to an iPad storyboard, do the following:

    1. From Xcode, right-click on the storyboard and choose Open As -> Source code

    2. Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad"

    3. Right-click on the storyboard again and choose Open As -> iOS Storyboard

    The storyboard will now show all views in the correct size.

    ################

    http://stackoverflow.com/questions/8465769/converting-storyboard-from-iphone-to-ipad

    http://stackoverflow.com/questions/9877113/xcode-storyboard-why-does-the-ipad-storyboard-show-iphone-sized-views

  • 相关阅读:
    SQL Server中字段类型对应的C#中的数据类型
    ADO.NET复习总结(4)--访问SqlServer的类
    ADO.NET复习总结(3)--参数化SQL语句--防止sql注入式攻击
    关于MAX()函数的一点思考
    MySQL in or效率对比
    php trim源码分析
    MySQL MVCC机制
    一致性hash
    MySQL锁总结
    网关 php-cgi fastcgi phpfpm
  • 原文地址:https://www.cnblogs.com/savagemorgan/p/3740741.html
Copyright © 2011-2022 走看看