修改了我的页面中顶部视图约束冲突的

This commit is contained in:
fengshuo
2021-12-07 14:57:33 +08:00
parent ecbb2cfa53
commit 3744ac0c30

View File

@@ -80,8 +80,6 @@
@interface XPMineAccountView ()
///
@property (nonatomic,strong) UIStackView *stackView;
///
@property (nonatomic,strong) XPMineAccountSubView *accountView;
///
@@ -101,29 +99,23 @@
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];
[self.stackView addArrangedSubview:self.accountView];
[self.stackView addArrangedSubview:self.recommendView];
[self addSubview:self.accountView];
[self addSubview:self.recommendView];
}
- (void)initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self).inset(15);
[self.accountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).inset(15);
make.top.bottom.mas_equalTo(self);
make.right.mas_equalTo(self.recommendView.mas_left).offset(-15);;
}];
[self.recommendView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).offset(-15);
make.top.bottom.width.mas_equalTo(self.accountView);
}];
}
#pragma mark - Getters And Setters
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFillEqually;
_stackView.alignment = UIStackViewAlignmentFill;
_stackView.spacing = 15;
}
return _stackView;
}
- (XPMineAccountSubView *)accountView {
if (!_accountView) {