美文网首页
Masonry 并排布局

Masonry 并排布局

作者: 昔年丶流光_8840 | 来源:发表于2018-10-12 09:50 被阅读0次

水平并排布局,自动适应宽度,适合多view布局。

    
    //水平方向等间隔布局
    //Spacing:间隔距离
    //leadSpacing:距离最左面
    //tailSpacing:距离最右面
    [imageArray mas_distributeViewsAlongAxis:MASAxisTypeHorizontal
                           withFixedSpacing:widthSU*15
                                leadSpacing:widthSU*31
                                tailSpacing:widthSU*65];
    [imageArray mas_makeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(self->title.bottom).with.offset(heightSU*16);
        make.height.equalTo(heightSU*118);
    }];

竖直方向布局,自动计算高度。

    
    //竖直方向等间隔布局 MASAxisTypeVertical
    //水平方向等间隔布局 MASAxisTypeHorizontal
    //Spacing:间隔距离
    //leadSpacing:距离最上面
    //tailSpacing:距离最下面
    
    [listArray mas_distributeViewsAlongAxis:MASAxisTypeVertical
                              withFixedSpacing:0
                                   leadSpacing:0
                                   tailSpacing:heightSU*152];
    [listArray mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self).with.offset(heightSU*47);
        make.right.equalTo(self).with.offset(-heightSU*37);
//        make.height.equalTo(heightSU*94);
    
    }];

读取plist文件

[[NSArray alloc]initWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"cityGroups" ofType:@"plist"]];

相关文章

  • Masonry 并排布局

    水平并排布局,自动适应宽度,适合多view布局。 竖直方向布局,自动计算高度。 读取plist文件

  • iOS局部圆角

    注意 Masonry布局时,要在Masonry布局后调用

  • 适配

    Masonry iOS自动布局框架-Masonry详解

  • oc 的画面布局

    画面布局:SDAutoLayout、Masonry Masonry : 简单例子: self.viewTwo= ...

  • 使用Masonry代码进行屏幕适配的详细介绍

    Masonry自动布局使用 Masonry是一个轻量级的布局框架,采用更好的语法封装自动布局,它有自己的布局DSL...

  • Masonry简单用法 (一)

    Masonry是一个布局框架。 下载地址:https://github.com/Masonry/Masonry 安...

  • App架构方方面面

    布局 揭秘 iOS 布局 Masonry源码解析 自动布局&绝对布局autolayoutautolayout 动画...

  • Third Party

    A:推荐使用 B:修改使用 C:参考使用 自动布局Masonry(A)iOS自动布局框架-Masonry详解SDA...

  • iOS 常用布局方式之Masonry

    级别: ★☆☆☆☆标签:「iOS Masonry」「iOS 自动布局」「Masonry」作者: Xs·H审校: ...

  • 源码解读——Masonry

    原文链接 Masonry 概述 Masonry 是基于 Apple 的自动布局封装的一个轻量级布局框架。Mason...

网友评论

      本文标题:Masonry 并排布局

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