我的代码是这样的:
self.childView= [[UIView alloc]initWithFrame:screen];
[self.view addSubview: self.childView];
self.childView.backgroundColor = [UIColor redColor];
UIButton *button = [[UIButton alloc]init];
[self.childView addSubview: button];
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.childView).with.insets(UIEdgeInsetsMake(100, 200, 100, 100));
}];使用masonry来给视图自动添加约束,思路-->父视图上面添加一个子视图,该子视图上面把所有要显示的视图都添加在它上面但运行报错:
Exception:-[UIButton mas_makeConstraints:]: unrecognized selector sent to instance 0x7feef061f520大神求帮助
self.childView= [[UIView alloc]initWithFrame:screen];
[self.view addSubview: self.childView];
self.childView.backgroundColor = [UIColor redColor];
UIButton *button = [[UIButton alloc]init];
[self.childView addSubview: button];
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.childView).with.insets(UIEdgeInsetsMake(100, 200, 100, 100));
}];使用masonry来给视图自动添加约束,思路-->父视图上面添加一个子视图,该子视图上面把所有要显示的视图都添加在它上面但运行报错:
Exception:-[UIButton mas_makeConstraints:]: unrecognized selector sent to instance 0x7feef061f520大神求帮助
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货