.xib文件和.storyboard有什么区别? [英] What is the difference between a .xib file and a .storyboard?

查看:154
本文介绍了.xib文件和.storyboard有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以用简单的词语解释.xib和.storyboard之间的区别吗?

Can someone explain in simple words the difference between .xib and .storyboard?

推荐答案

Apple在iOS5 SDK中引入了storyboarding的概念简化并更好地管理应用中的屏幕。您仍然可以使用 .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.

预故事板,每个 UIViewController 都有一个关联的 .xib 用它。 故事板实现两件事:

Pre-storyboard, each UIViewController had an associated .xib with it. Storyboard achieves two things:


  1. 。 storyboard 本质上是应用程序中所有屏幕的单个文件,它显示了屏幕的流程。您可以通过这种方式在屏幕之间添加 segues /过渡。因此,这可以最大限度地减少管理多个屏幕所需的样板代码。

  1. .storyboard is essentially one single file for all your screens in the app and it shows the flow of the screens. You can add segues/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.

你可以参考这个教程

这篇关于.xib文件和.storyboard有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆