IOS 自动布局指南1 介绍(auto layout guide)
来源:互联网 发布:室内设计案例优化 编辑:程序博客网 时间:2024/05/16 10:04
前言:
只要你开发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, read Adopting 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 Xcode 5 provides powerful workflows for rapidly and easily creating and maintaining constraint-based layouts in OS X and iOS apps. With Xcode 5, 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
- 当你准备好的时候添加约束(constraint)
- 使用拖拽,或者菜单快速添加约束
- 分别更新约束(constraint)和框架(frame)
- 指定约束动态视图的占位符
- 查看,理解,解决有关冲突约束(constraint)和不清楚的视图(View)的问题
Organization of This Document(这些文档的组织)——这些文章之后会翻译
Read the following chapters to learn how to use Auto Layout:
Auto Layout Concepts to learn about the main concepts you need to understand when using Auto Layout
Working with Constraints in Interface Builder to learn about using Interface Builder to create and edit layout constraints
Working with Auto Layout Programmatically to learn about working with Auto Layout in code
Resolving Auto Layout Issues to learn about identifying and debugging issues with your layout
Auto Layout by Example to see examples of common Auto Layout use cases
Implementing a Custom View to Work with Auto Layout to learn how to implement a custom view that interoperates with Auto Layout
Adopting Auto Layout to learn how to adopt Auto Layout in an existing project that doesn’t use Auto Layout
Visual Format Language to learn about the language used to create constraints in code
- 《自动布局的概念》学习当你使用自动布局时候需要理解的主要概念
- 《在界面生成器中约束是怎样工作的》学习在界面生成器中创建和编辑布局约束
- 《在代码中自动布局如何工作》学习自动布局在代码中是如何工作的
- 《解决自动布局问题》学习如何辨认和调试你的布局问题
- 《自动布局例子》学习我们使用的自动布局的普通例子
- 《完成一个使用自动布局的自定义视图》学习完成一个使用自动布局的自定义视图
- 《采用自动布局》学习如何对一个未采用自动布局的已存在项目使用自动布局
- 《可视格式语言》学习在程序中创建 约束的语言
- IOS 自动布局指南1 介绍(auto layout guide)
- IOS 自动布局指南1 介绍(auto layout guide)
- Auto Layout Guide---自动布局指南(一)
- Auto Layout Guide---自动布局指南(二)
- Auto Layout Guide---自动布局指南(三)
- IOS 自动布局指南2 自动布局概念(Auto Layout Concepts)
- iOS 中 Auto Layout(自动布局)
- IOS 6 自动布局 入门-1 (Auto Layout)
- iOS自动布局(Auto Layout
- iOS 自动布局 Auto Layout 入门 01 背景介绍
- 学会爱上iOS自动布局(Auto Layout)(转)
- iOS 6 编程 - 自动布局(Auto Layout)系列文章
- iOS 6 编程 - 自动布局(Auto Layout)系列文章
- iOS自动布局-Auto Layout
- iOS自动布局Auto Layout 与 SizeClass
- 自动布局auto layout
- iOS 自动布局 Auto Layout 入门 02 使用自动布局
- iOS 10 Auto Layout界面自动布局系列1-自动布局的基本原理
- OMCI协议二层功能的模型选择
- oracle 分析函数
- iOS 面试大全从简单到复杂(简单篇)
- 如何使用命令查看电脑开放的端口
- mac系统安装软件
- IOS 自动布局指南1 介绍(auto layout guide)
- JAVA高并发学习笔记(三) JMM(Java内存模型)
- 导入jquery.min.js文件会报错怎么办?
- 模拟退火算法2(实例分析)--Matlab算法
- USES_CONVERSION 的陷阱
- jsp sql 防注入方法解析
- 点击a链接下载附件代码
- 来惠普的这两周
- linux常用命令(19):find命令概览