代码库> 其他> iOS 流式自动布局 适配All Screen
iOS 流式自动布局 适配All Screen
关注
上传者:xincc 分类:其他(Others)
查看次数:3191 下载次数:240
上传时间:2015-09-08 大小:41 B
 //bg view
    UIView * viewBackGround = [[UIView alloc] initWithFrame:CGRectZero];


    viewBackGround.backgroundColor = UIColor.redColor;
    [self.view addSubview:viewBackGround fillByMargin:ALMarginZero()];




//clip to two part

    UIView * topPart = [[UIView alloc] initWithFrame:CGRectZero];
    UIView * bottomPart = [[UIView alloc] initWithFrame:CGRectZero];
    topPart.backgroundColor = UIColor.blackColor;
    bottomPart.backgroundColor = UIColor.darkGrayColor;

    [viewBackGround addSubviews:@[topPart, bottomPart] flowLayoutDirection:ALLayoutDirectionVertical fillByMargin:ALMarginMakeLeft(50)];

//set top part
    UIView * topPart1 = [[UIView alloc] initWithFrame:CGRectZero];
    UIView * topPart2 = [[UIView alloc] initWithFrame:CGRectZero];
    UIView * topPart3 = [[UIView alloc] initWithFrame:CGRectZero];
    topPart1.backgroundColor = UIColor.brownColor;
    topPart2.backgroundColor = UIColor.greenColor;
    topPart3.backgroundColor = UIColor.blueColor;


    [topPart addSubviews:@[topPart1,topPart2,topPart3] flowLayoutDirection:ALLayoutDirectionHorizontal fillByMargin:ALMarginMakeTop(100) interval:20.f];

//set bottom part
    UIView * bottomPart1 = [[UIView alloc] initWithFrame:CGRectZero];
    UIView * bottomPart2 = [[UIView alloc] initWithFrame:CGRectZero];
    UIView * bottomPart3 = [[UIView alloc] initWithFrame:CGRectZero];
    bottomPart1.backgroundColor = UIColor.cyanColor;
    bottomPart2.backgroundColor = UIColor.yellowColor;
    bottomPart3.backgroundColor = UIColor.purpleColor;


    [bottomPart addSubviews:@[bottomPart1,bottomPart2,bottomPart3] flowLayoutDirection:ALLayoutDirectionVertical fillByMargin:ALMarginMakeRight(50) interval:10.f];


测试环境:Xcode 6.2,iOS 6.0 以上
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0


综合评论
  • 您好  请问demo可以展示图片, 但是放到我的工程项目里面 ...
    18640768232 评论了 DDPhotoBrowser
  • 我主页开源很多精品喜欢来个小星星 https://gitee.com/cocoscreat...
    17069818154 评论了 CocosCreator左右跳
  • 1
    15777131570 评论了 Swift5高仿最新有妖气APP
  • mark!!!
    18810473635 评论了 瀑布流布局
  • 写Demo用cocoaPods的都是**
    抠脚小金刚 评论了 混合轮播图
  • 楼主竟然把公司的项目发到网上,估计只有一种可能了,就是当初被公司坑了,怀恨在心,就像当年我删库跑路一...
    13816490147 评论了 商城
提示
sina weixin mail 回到顶部