HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – xcode 6.1 iphone / ipad storyboard大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
试图在 xcode的新故事板上设计 iphone UI:

对于设计iphone UI来说,这似乎有点随意.

我期待某种形式的’iphone”ipad”可扩展’的界限或线条,但我能找到的就是这个单一的故事板.它现在真的只是单个故事板还是我缺少一些额外的控件?

解决方法

从XCode 6开始,使用名为Size Classes的新功能组合了iPhone和iPad的故事板.这是一件好事(大部分时间),因为它可以让你设计一个适应不同屏幕尺寸的界面.

当然,在某些情况下,您可能希望为iPhone和iPad使用不同的故事板.毕竟,有些应用只需要在手掌和平板电脑尺寸的设备上采用完全不同的方法.

如果你想使用新的Size Classes,请参阅越来越多的教程之一,比如ray Wenderlich:http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial.

如果您想为iPhone和iPad使用单独的故事板,请按以下步骤操作:

>从新的单视图应用程序开始.

a. SELEct File|New|Project.

b. SELEct iOS,Application and click "Single View Application."

c. Click Next.

d. Give the project a name,then click "Next."

e. Pick a LOCATIOn and click "Create" to create the project.

>将起始故事板转换为iPhone故事板.

a. SELEct Main.storyboard,and SELEct the file inspector (the document icon at the top of the right panE) if it is not already SELEcted.

b. Uncheck "Use Size Classes."
c. A dlialog will appear. SELEct "iPhone" from the drop down menu,then click "Disable Size Classes."
d. Rename the storyboard as "Main_iPhone.storyboard."

>创建iPad故事板.

a. SELEct File|New|File from the menu bar. From the dialog that appears,SELEct iOS|UserInterface. Click on "Storyboard" and click "Next."
b. Rename the file as "Main_iPad.storyboard," then save it,typically in the Base.lproj folder of your project folder.
c. Add a view controller,and make it the initial view controller by clicking the "Is Initial View Controller" check Box in the Attributes Inspector pane.

>按照与上面#2相同的步骤将新故事板转换为iPad故事板,但这次选择平台时选择iPad而不是iPhone.
>将故事板链接到应用程序.

a. Open the Info.plist.

b. Change the name for "Main storyboard file base name" from "Main" to "Main_iPhone.storyboard".

.c Add a new property called "Main storyboard file base name (iPad)" and give it the name "Main_iPad."

而已!您现在可以像往常一样为iPhone和iPad创建单独的UI.

大佬总结

以上是大佬教程为你收集整理的ios – xcode 6.1 iphone / ipad storyboard全部内容,希望文章能够帮你解决ios – xcode 6.1 iphone / ipad storyboard所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。