uikit——Auto Layout——UIView——anchor
阿新 • • 發佈:2019-01-27
anchor
解釋:@interface UIView (UIViewLayoutConstraintCreation) /* Constraint creation conveniences. See NSLayoutAnchor.h for details. */ @property(readonly, strong) NSLayoutXAxisAnchor *leadingAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutXAxisAnchor *trailingAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutXAxisAnchor *leftAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutXAxisAnchor *rightAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutYAxisAnchor *topAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutYAxisAnchor *bottomAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutDimension *widthAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutDimension *heightAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutXAxisAnchor *centerXAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutYAxisAnchor *centerYAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutYAxisAnchor *firstBaselineAnchor NS_AVAILABLE_IOS(9_0); @property(readonly, strong) NSLayoutYAxisAnchor *lastBaselineAnchor NS_AVAILABLE_IOS(9_0); @end
- leadingAnchor:NSLayoutAttributeLeading
- trailingAnchor:NSLayoutAttributeTrailing
- leftAnchor:NSLayoutAttributeLeft
- rightAnchor:NSLayoutAttributeRight
- topAnchor:NSLayoutAttributeTop
- bottomAnchor:NSLayoutAttributeBottom
- widthAnchor:NSLayoutAttributeWidth
- heightAnchor:NSLayoutAttributeHeight
- centerXAnchor:NSLayoutAttributeCenterX
- centerYAnchor:NSLayoutAttributeCenterY
- firstBaselineAnchor:NSLayoutAttributeFirstBaseline
- lastBaselineAnchor:NSLayoutAttributeLastBaseline