IOS 自动布局指南1 介绍(auto layout guide)

前言:

只要你开发IOS,,布局是你绕不开的一个弯,随着iPhone6的推出,苹果设备也面对着多设备适配的问题,传统的根据屏幕尺寸计算位置手动布局的方法,将会随着设备的尺寸增多越发的效率滴下。今天上网搜索,中文相关的适配教程都不是很合心意,于是抽出今天一天时间,翻译苹果文档:自动布局指南系列,鉴于水平有限,我列出原文,配上翻译,翻译不到位的地方,诸君可以直接看原文,闲话少许,我们开始。

Introduction(介绍)

Auto Layout is a system that lets you lay out your app’s user interface by creating a mathematical description of the relationships between the elements. You define these relationships in terms of constraints either on individual elements, or between sets of elements. Using Auto Layout, you can create a dynamic and versatile interface that responds appropriately to changes in screen size, device orientation, and localization.

译文:

自动布局呢是一个系统,这个系统可以让你使用数学数学描述的元素之间的关系来在你应用的用户界面布局。不论是单个元素,或者多个元素,你都可以定义他们关系的约束。使用自动布局,你可以创建一个动态的灵活的用户界面,以响应屏幕,设备以及位置的变化。

Auto Layout is built into Interface Builder in Xcode 5, and is available to apps targeted at either iOS and OS X. Auto Layout is enabled by default when you create a new project. If you have an existing project that doesn’t use Auto Layout, readAdopting Auto Layout.

The typical workflow for creating user interfaces starts by using Interface Builder to create, reposition, resize, and customize your views and controls. When you are satisfied with the positions and settings, you’re ready to start adding Auto Layout constraints so that your interface can react to changes in orientation, size, and localization.

译文:

自动布局内置在Xcode 5 的用户界面生成器中,它可以同时使用在IOS和OS X系统的app开发中。当年创建一个新项目的时候,自动布局是默认启用的。如果你有一个没有使用自动布局的现有项目,读这篇文章:《采用自动布局》

创建用户界面的典型工作流程开始于创建,重定位置,重定大小,自定义你的视图和控件。当你获得了合适的位置和设置以后,你就可以准备加上自动布局约束,这样可以让你的用户界面适应方向,大小,位置的变化。

At a Glance(概述)

Auto Layout in Xcode5 provides powerful workflows for rapidly and easily creating and maintaining constraint-based layouts in OS X and iOS apps. With Xcode5, you can:

Add constraints when you are ready

Quickly add constraints using control-drag or menu options

Update constraints and frames separately

Specify placeholder constraints for dynamic views

See, understand, and resolve issues with conflicting constraints or ambiguous views

在Xcode5中自动布局提供了强有力的工作流程,是你可以快速轻易的构建可维护的基于约束布局的IOS和OSX 应用。使用XCode5你可以这么干:

Organization of This Document(这些文档的组织)——这些文章之后会翻译

Read the following chapters to learn how to use Auto Layout:

Auto Layout Conceptsto learn about the main concepts you need to understand when using Auto Layout

Working with Constraints in Interface Builderto learn about using Interface Builder to create and edit layout constraints

Working with Auto Layout Programmaticallyto learn about working with Auto Layout in code

Resolving Auto Layout Issuesto learn about identifying and debugging issues with your layout

Auto Layout by Exampleto see examples of common Auto Layout use cases

Implementing a Custom View to Work with Auto Layoutto learn how to implement a custom view that interoperates with Auto Layout

Adopting Auto Layoutto learn how to adopt Auto Layout in an existing project that doesn’t use Auto Layout

Visual Format Languageto learn about the language used to create constraints in code

译文:读下面的章节学习如何使用自动布局

人要有梦想,有了梦想才会努力奋斗,

IOS 自动布局指南1 介绍(auto layout guide)

相关文章:

你感兴趣的文章:

标签云: