storyboard开发指南(1)简介

https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/Chapters/AboutStoryboards.html#//apple_ref/doc/uid/TP40014225-CH41-SW1

关于 Storyboards

iOS app使用一个或者多个情节串联图(Storyboard)来制定用户路径。

依据这些指定用户界面:

  • Scenes(场景)

  • Segues between scenes(场景间的连接)

  • Controls used to trigger the segues(控制用于触发连接)

一个scene展现一个屏幕内容区域。在iphone中一个屏幕通常包含一个单一的scene。一个segue代表一个scene到另一个scene的过渡,比如当一个scene滑动到其他的scene。如果项目会很大很复杂,你可以创建额外的故事版。

Segue模式:

Custom:自己写它的行为

Push:将内容推到当前堆栈视图控制器中

Modal:默认的是这个:Present the content modally on top of the existing screen. The options are the same as Present Modally.

AutoLayout约束模式:

Constraint attributes

The attributes fall into three categories:

  • Horizontal positioning: Leading, Trailing, Left, Right, and Center

  • Vertical positioning: Top, Bottom, Center, and Baseline

  • Size: Width, Height, and Aspect Ratio

Left refers to the left edge of an item’s alignment rectangle,

Bottom refers to the bottom edge of an item’s alignment rectangle,

Width refers to the width of an item’s alignment rectangle, and so forth.

With constraints, you align these rectangles, define the space between them, and size them.

Leading refers to the edge of the alignment rectangle where words and sentences begin; 

Leading指的是矩形区域单词句子开始的边缘

Trailing refers to the edge where words and sentences end.

Trailing指的是单词句子结束的边缘

For left-to-right languages such as English, Leading is the same as Left, whereas in a right-to-left environment such as Hebrew or Arabic, Leading is the same as Right. Similarly, Trailing is the same as Right for English, but Trailing is the same as Left for Hebrew and Arabic. You should use Leading and Trailing to make sure your interface is laid out appropriately in all languages, unless the horizontal position should remain fixed at left or right regardless of the language.

The Baseline attribute is available only for items that have baselines. Baseline refers to an invisible line, offset from the bottom of the alignment rectangle, along which glyphs of characters are laid out.

For a size attribute, you can specify a fixed number of points (such as a width of 80), a proportional relationship (for example, defining the width of one item to be twice the width of another), or an aspect ratio (for example, defining the width of an item to be twice its height).

Size属性:可以固定值,可以是比例值(自己的宽是别的宽的两倍),可以是长宽比(定义宽视高的两倍)。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值