show the attributes inspector
show the file inspector
show quick help inspector
show the size inspector
show the connections inspector
show the identity inspector
inspector检察员
IBInspectble
<constraint firstItem="tHo-sn-gmk" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="40" id="L2d-aO-BgM">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="adpthvalue">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="coloraa">
<color key="value" red="0.81173076919999998" green="0.76236778849999998" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
兄弟姐妹/ 祖先约束
sibling & ancestor constraints
后代约束
descendant constraints
uiview的priroity
1、content hugging priority
horizontal
vertical
2、content compression resistance priority
horizontal
vertical
3、intrinsic size---placehodler width , height
intrinsic ContentSize
4、ambiguity
约束的种类
1、间隔约束
horizontal space constraint
vertical space constraint
// [NSLayoutConstraint constraintWithItem:<#(nonnull id)#>
// attribute:<#(NSLayoutAttribute)#>
// relatedBy:<#(NSLayoutRelation)#>
// toItem:<#(nullable id)#>
// attribute:<#(NSLayoutAttribute)#>
// multiplier:<#(CGFloat)#>
// constant:<#(CGFloat)#>
view1
The view for the left side of the constraint.
attr1
The attribute of the view for the left side of the constraint.
relation
The relationship between the left side of the constraint and the right side of the constraint.
view2
The view for the right side of the constraint.
attr2
The attribute of the view for the right side of the constraint.
multiplier
The constant multiplied with the attribute on the right side of the constraint as part of getting the modified attribute.
c
The constant added to the multiplied attribute value on the right side of the constraint to yield the final modified attribute.
6个(
first item,
ralation,// 等于、大于或等于、小于或等于
second item,
constant
priority
multiplier
)
2、固定宽、高约束
width constraint
height constraint
4个(
first item
relation
constant
priority
)
3、比例约束
aspect ratio constraint
6个(
first item
relation
second item
constant
priority
mulitiplier
)
网友评论