From 3744ac0c30f7ab69f2f4d268465f3e64f480fd39 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Tue, 7 Dec 2021 14:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=AD=E9=A1=B6=E9=83=A8=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E7=BA=A6=E6=9D=9F=E5=86=B2=E7=AA=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mine/View/SubViews/XPMineAccountView.m | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m index 7ba91515..578aac78 100644 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m @@ -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) {