// // SPSBSafeProblemDetailsViewController.m // 我的社保 // // Created by shanp on 2021/5/22. // #import "SPSBSafeProblemDetailsViewController.h" #import "SPSBUIGeneralHeader.h" @interface SPSBSafeProblemDetailsViewController () { UIScrollView *_bgView; UIView *_questionView; } @end @implementation SPSBSafeProblemDetailsViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupUI]; } #pragma mark - Action #pragma mark - Network Action #pragma mark - UI - (void)setupUI { self.title = @"常见问题"; [self createBgView]; [self createQuestionView]; [self createAnswerView]; } - (void)createBgView { _bgView = [UIScrollView convenienceWithBackgroundColor:spsb_FFFFFF_color(1.f)]; [self.view addSubview:_bgView]; [_bgView makeConstraints:^(JXHConstraintMaker *make) { make.edges.equalTo(self.view); }]; } - (void)createQuestionView { _questionView = UIView.new; [_bgView addSubview:_questionView]; [_questionView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); make.width.equalTo(jxh_screenWidth()); }]; UILabel *question = [UILabel convenienceWithFont:spsb_semiboldFont(17) textColor:spsb_333333_color() limitWidth:jxh_screenWidth() - 56]; [question setAttributedStringWithText:_spsb_question[@"question"] lineSpacing:5]; [_questionView addSubview:question]; [question makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(28); make.trailing.equalTo(-28); make.top.equalTo(20); make.bottom.equalTo(-20); }]; } - (void)createAnswerView { UIView *answerView = UIView.new; [_bgView addSubview:answerView]; [answerView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(self->_questionView.bottom); make.leading.and.trailing.equalTo(0); make.bottom.equalTo(-40); }]; UILabel *answer = [UILabel convenienceWithFont:spsb_font(16) textColor:spsb_333333_color() limitWidth:jxh_screenWidth() - 56]; [answer setAttributedStringWithText:_spsb_question[@"answer"] textAlignment:NSTextAlignmentLeft lineSpacing:5 lineHeight:0 paragraphSpacing:10 lineBreakMode:NSLineBreakByWordWrapping]; [answerView addSubview:answer]; [answer makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(28); make.trailing.equalTo(-28); make.top.equalTo(16); make.bottom.equalTo(0); }]; } @end