美文网首页
Masonry(约束安装过程):

Masonry(约束安装过程):

作者: GodyZ | 来源:发表于2016-06-08 07:58 被阅读140次

    View+MASAdditions (入口)

    • 定义约束条件:
    • 构建约束: mas_makeConstraints, mas_updateConstraints, mas_remakeConstraints
    • 查找公共父视图:mas_closestCommonSuperview

    MASConstraintMaker

    • addConstraintWithLayoutAttribute (使用点方法添加约束 MASViewConstraint)
    • install (安装所有约束) -> [MASViewConstraint install]

    MASViewConstraint

    • firstViewAttribute (MASViewAttribute)
    • secondViewAttribute (MASViewAttribute)
    • install:[self.installView(commonSuperView) addConstraint:MASViewConstraint] (为对应的view安装单个约束)

    MASViewAttribute

    • layoutAttribute (NSLayoutAttribute)
    • relatedView (UIView)

    MASLayoutConstraint : NSLayoutConstraint

     [MASLayoutConstraint constraintWithItem:firstView  (约束的创建)
                                            attribute:firstViewAttribute
                                            relatedBy:self.layoutRelation
                                               toItem:secondView
                                            attribute:secondViewAttribute
                                           multiplier:self.layoutMultiplier
                                             constant:self.layoutConstant]
    

    相关文章

      网友评论

          本文标题:Masonry(约束安装过程):

          本文链接:https://www.haomeiwen.com/subject/hkhjdttx.html