UILabel *label1 = [[UILabel alloc] init]; label1.text = @"123123123123"; UILabel *label2 = [[UILabel alloc] init]; label2.text = @"12312312123123123"; label1.backgroundColor = [UIColor redColor]; label2.backgroundColor = [UIColor blueColor]; [self.view addSubview:label1]; [self.view addSubview:label2]; [label1 mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.view).offset(50); make.top.equalTo(self.view).offset(300); }]; [label2 mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(label1); make.left.equalTo(label1.mas_right).offset(10); }]; Label与Button是不需要具体确定宽高的
Label与Button是不需要具体确定宽高的