zoukankan      html  css  js  c++  java
  • Autolayout

    1.这个位置选适应什么样子的屏幕

    2.两种方法选择约束

    第一种:

    第二种:

    3.代码添加约束————导入第三方库Masnory

     [super viewDidLoad];

        UIView * redview = [[UIView alloc]init];

        redview.backgroundColor = [UIColor redColor];

        [self.view addSubview:redview];

        UIView * blueview = [[UIView alloc]init];

        blueview.backgroundColor = [UIColor blueColor];

        [self.view addSubview:blueview];

      

        [redview mas_makeConstraints:^(MASConstraintMaker *make) {

            make.leading.equalTo(self.view.mas_leading).offset(10);

            make.top.equalTo(self.view.mas_top).offset(10);

            make.height.equalTo(@100);

        }];

        [blueview mas_makeConstraints:^(MASConstraintMaker *make) {

            make.trailing.equalTo(self.view.mas_trailing).offset(-10);

            make.top.equalTo(self.view.mas_top).offset(10);

            make.height.equalTo(redview.mas_height).offset(0);

            make.width.equalTo(redview.mas_width).offset(0);

            make.leading.equalTo(redview.mas_trailing).offset(10);

        }];

  • 相关阅读:
    poj 1700 Crossing River 过河问题。贪心
    Alice's Print Service
    POI 2000 ------Stripes
    Uva 1378
    hdu 3068 最长回文
    bnu Game 博弈。
    链栈的C语言实现
    链栈的C语言实现
    顺序栈C语言实现
    顺序栈C语言实现
  • 原文地址:https://www.cnblogs.com/huoran1120/p/5133757.html
Copyright © 2011-2022 走看看