iOS 5 中使用 Storyboard 有什么特别之处
我是 ios 开发的新手,视图的概念对我来说看起来很困惑。例如,我正在创建一个“单视图应用程序”,现在选择“故事板”有什么特别之处。简而言之,使用视图控制器并在其中添加多个视图控制器屏幕与使用故事板有什么区别?
i am new to ios development and the concept of views looks confusing to me. For instance i am creating a 'single view application', now whats special in selecting 'story board'. In short what is the difference in using a viewcontroller and adding multiple viewcontroller screens in it and using a storyboard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
故事板是:
所有场景的容器(视图控制器、导航控制器、TabBar 控制器等)。
这些场景之间的连接和转换的管理器(称为 Segue)。
管理不同控制器如何相互通信的好方法。
故事板可以让您完整地了解应用程序的流程,这是您永远无法从浮动的单个 nib 文件中获得的。
当您有多个控制器,每个控制器都有自己的 nib 文件时,会减少所有“混乱”。
我已经使用 Storyboards 一段时间了,唯一的缺点是你无法针对 iOS 4 或更低版本。故事板仅适用于运行 iOS 5 或更高版本的设备。除此之外,在我看来,好处很多,缺点也不存在。
我见过的最好的教程是 Ray Wenderlich 的
另外,如果您是作为 Apple Developer 计划的成员,请查看去年 WWDC 上 Storyboards (iTunesU) 的会议,非常棒。
另一个很棒的课程(也在 iTunesU 上)是最新的斯坦福 iOS 应用程序编程课程。
A Storyboard is:
A container for all your Scenes (View Controllers, Nav Controllers, TabBar Controllers, etc).
A manager of connections and transitions between these scenes (these are called Segues).
A nice way to manage how different controllers talk to each other.
Storyboards give you a complete look at the flow of your application that you can never get from individual nib files floating around.
A reducer of all the "clutter" that happens when you have several controllers each with it's own nib file.
I have been using Storyboards for awhile now and the ONLY downside is that you can't target iOS 4 or below. Storyboards only work on devices running iOS 5 or better. Other than that, the benefits are many and the downsides are non-existent IMO.
The best tutorial I have seen is Ray Wenderlich's
Also, if you are a member of the Apple Developer program, check out last years WWDC session on Storyboards (iTunesU), it is awesome.
Another great one (also on iTunesU) is the latest Stanford iOS Application Programming course.
浏览这些关于 ios 5 的教程,他很好地解释了 ios5 中的新功能以及如何轻松地在编码中使用...
http://www.raywenderlich.com/5113/announcing-the-ios-5-feast
go through these tutorials about ios 5, he has explained very nice about new features in ios5 and how to use in coding very easily...
http://www.raywenderlich.com/5113/announcing-the-ios-5-feast
通过使用故事板,您可以创建视图并使用单个文件连接它们,而不是为一个视图创建一个 nib 文件。
您可以在 google 上搜索“iPhone 故事板教程”并获得大量可遵循的教程。
By using story board you can create your views and connect them using the single file rather than creating one nib file for one view.
You can google for "story board tutorial iphone" and get lots of tutorial to follow.