// // SPSBViewManager.m // 我的社保 // // Created by shanp on 2021/4/20. // #import "SPSBViewManager.h" #import "SPSBUIGeneralHeader.h" UIView *spsb_createNumberTipsViewWithTag(NSInteger tag) { UIView *tipsView = [[UIView alloc] init]; tipsView.tag = tag; tipsView.backgroundColor = spsb_FFFFFF_color(1.f); [tipsView setLayerCornerRadius:9.5 clipToBounds:false]; UIView *redView = [[UIView alloc] init]; redView.backgroundColor = spsb_FF5E5E_color(); [redView setLayerCornerRadius:8 clipToBounds:false]; [tipsView addSubview:redView]; [redView makeConstraints:^(JXHConstraintMaker *make) { make.edges.equalTo(UIEdgeInsetsMake(1.5, 1.5, 1.5, 1.5)); make.height.equalTo(16); make.width.greaterThanOrEqualTo(16); }]; UILabel *num = [UILabel convenienceWithFont:spsb_semiboldFont(11) text:@"0" textColor:spsb_FFFFFF_color(1.f) textAlignment:NSTextAlignmentCenter]; num.tag = spsb_numberTipsViewLabelTag; [redView addSubview:num]; [num makeConstraints:^(JXHConstraintMaker *make) { make.leading.greaterThanOrEqualTo(4); make.trailing.lessThanOrEqualTo(-4); make.center.equalTo(redView).priorityRequired(); }]; return tipsView; } UIView *spsb_createShotViewHeaderWithTitle(NSString *title, SEL action, id target) { UIView *headerView = UIView.new; UIView *icon = UIView.new; icon.backgroundColor = spsb_3296FB_color(); [icon setLayerCornerRadius:1.5 clipToBounds:false]; [headerView addSubview:icon]; [icon makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(15); make.top.equalTo(headerView.top).offset(20); make.size.equalTo(CGSizeMake(3, 16)); }]; UILabel *titleLabel = [UILabel convenienceWithFont:spsb_semiboldFont(16) textColor:spsb_333333_color() limitWidth:jxh_screenWidth() - 30 - 54]; titleLabel.tag = spsb_headerViewLabelTag; [titleLabel setAttributedStringWithText:title lineSpacing:6]; [headerView addSubview:titleLabel]; [titleLabel makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(30); make.trailing.equalTo(-54); make.top.equalTo(17); make.bottom.equalTo(-17); }]; UIButton *closeButton = [UIButton convenienceWithTarget:target action:action]; [headerView addSubview:closeButton]; [closeButton makeConstraints:^(JXHConstraintMaker *make) { make.top.and.trailing.equalTo(0); make.size.equalTo(CGSizeMake(54, 54)); }]; UIImageView *closeImageView = [[UIImageView alloc] initWithImage:jxh_getImage(close)]; [headerView addSubview:closeImageView]; [closeImageView makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-16); make.centerY.equalTo(closeButton); }]; [headerView createLineWithLocation:JXHLineLocationBottom]; return headerView; }