iOS: 布局可视化语法 Visual Format Syntax

可视化语法 Visual Format Syntax

The following are examples of constraints you can specify using the visual format. Note how the text visually matches the image.

标准宽度 Standard Space

[button]-[textField]

宽度约束 Width Constraint

[button(>=50)]

与父视图关联 Connection to Superview

|-50-[purpleBox]-50-|

垂直布局 Vertical Layout

V:[topField]-10-[bottomField]

直连视图 Flush Views

[maroonView][blueView]

Priority

[button(100@20)]

视图宽度相等 Equal Widths

[button1(==button2)]

多条件 Multiple Predicates

[flexibleButton(>=70,<=100)]

一行完整的布局 A Complete Line of Layout

|-[find]-[findNext]-[findField(>=20)]-|

原文地址:https://www.cnblogs.com/yaoyu126/p/3763768.html