問題描述
有人能用簡單的話解釋一下 .xib 和 .storyboard 之間的區別嗎?
Can someone explain in simple words the difference between .xib and .storyboard?
推薦答案
Apple 在 iOS5 SDK 中引入了 "storyboard"
的概念,以簡化和更好地管理應用中的屏幕.您仍然可以使用 .xib
的方式進行開發.
Apple introduced the concept of "storyboarding"
in iOS5 SDK to simplify and better manage screens in your app. You can still use the .xib
way of development.
Pre-storyboard,每個UIViewController
都有一個關聯的.xib
.Storyboard
實現了兩件事:
Pre-storyboard, each UIViewController
had an associated .xib
with it. Storyboard
achieves two things:
.storyboard
本質上是應用程序中所有屏幕的一個文件,它顯示了屏幕的流程.您可以通過這種方式在屏幕之間添加segues
/transitions.因此,這最大限度地減少了管理多個屏幕所需的樣板代碼.
.storyboard
is essentially one single file for all your screens in the app and it shows the flow of the screens. You can addsegues
/transitions between screens, this way. So, this minimizes the boilerplate code required to manage multiple screens.
最大限度地減少應用程序中的文件總數.
Minimizes the overall number of files in an app.
您可以通過取消選中使用故事板"選項來避免在創建新項目時使用 Storyboard
.
You can avoid using Storyboard
while creating a new project by leaving the "Use Storyboard" option unchecked.
您可以參考這個 教程開始吧.
You could refer this tutorial to get started.
這篇關于.xib 文件和 .storyboard 有什么區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!