.xib 文件和 .storyboard 有什么区别?

What is the difference between a .xib file and a .storyboard?(.xib 文件和 .storyboard 有什么区别?)
本文介绍了.xib 文件和 .storyboard 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有人能用简单的话解释一下 .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:

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

  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.

您可以参考这个 教程开始吧.

You could refer this tutorial to get started.

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
Resume game cocos2d(恢复游戏 cocos2d)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)