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);

        }];

  • 相关阅读:
    scrapy 随机UserAgent
    Scrapy使用中间件捕获Spider抛出的异常
    10.16-arrarylist
    10.15_package_2
    10.14_package_1
    10.13_enum_2
    10.12-enum_1
    10.11-java的接口2
    10.10-3对象和类_动手动脑-java的接口
    10.9-java的封装
  • 原文地址:https://www.cnblogs.com/huoran1120/p/5133757.html
Copyright © 2011-2022 走看看