12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- //
- // YOUPAIZYUserZiLiaoBHNoDataCell.m
- // VQU
- //
- // Created by 肖浩然的mac on 2021/7/16.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAIZYUserZiLiaoBHNoDataCell.h"
- @implementation YOUPAIZYUserZiLiaoBHNoDataCell
- -(instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:frame]) {
- [self youpaifsetSubView];
- }
- return self;
-
- }
- -(void)youpaifsetSubView{
- UIView *titleView = [UIView new];
- [self.contentView addSubview:titleView];
- [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.mas_equalTo(0);
- make.height.mas_equalTo(43);
- }];
- titleView.backgroundColor = LCBkgColor;
-
- self.youpaiptitleLabel = [[UILabel alloc] init];
- self.youpaiptitleLabel.font = LCBoldFont(14);
- [titleView addSubview:self.youpaiptitleLabel];
- [self.youpaiptitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(0);
- make.left.mas_equalTo(14);
-
- }];
-
- UIView *contentView = [UIView new];
- [self.contentView addSubview:contentView];
- [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(titleView.mas_bottom);
- make.left.mas_offset(0);
- make.right.mas_offset(0);
- make.bottom.mas_offset(0.f);
- }];
-
- contentView.backgroundColor = LCBkgColor;
- //分割线
- UIView *viewLine =[UIView new];
- [self addSubview:viewLine];
- [viewLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(14);
- make.right.mas_equalTo(-14);
- make.bottom.mas_equalTo(0);
- make.height.mas_equalTo(0.5f);
- }];
- viewLine.backgroundColor =HexColorFromRGB(0x28262D);
-
-
- UILabel *hintLabel = [UILabel new];
- [contentView addSubview:hintLabel];
- [hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.mas_equalTo(0);
- make.top.mas_equalTo(0);
- }];
- hintLabel.text = @"还没有人庇护Ta";
- hintLabel.font = [UIFont systemFontOfSize:14];
- hintLabel.textColor = HexColorFromRGB(0x6C6B70);
- //庇护按钮
- _youpaipbihuBtn = [UIButton new];
- [contentView addSubview:_youpaipbihuBtn];
- [_youpaipbihuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(hintLabel.mas_bottom).offset(8);
- make.centerX.mas_equalTo(0);
- make.size.mas_equalTo(CGSizeMake(ScaleSize(77), 22));
- }];
- [_youpaipbihuBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(ScaleSize(77), 22) FromColors:@[ZYGradientOneColor,ZYGradientTwoColor] ByGradientType:1] forState:UIControlStateNormal];
- [_youpaipbihuBtn setTitle:@"我要庇护" forState:UIControlStateNormal];
- _youpaipbihuBtn.titleLabel.font = [UIFont systemFontOfSize:12];
- [_youpaipbihuBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- _youpaipbihuBtn.layer.cornerRadius = 11;
- _youpaipbihuBtn.layer.masksToBounds = YES;
- [_youpaipbihuBtn addTarget:self action:@selector(youpaifbihuBtnClick) forControlEvents:UIControlEventTouchUpInside];
- }
- -(void)youpaifbihuBtnClick{
- if (self.youpaipdidClickBH) {
- self.youpaipdidClickBH();
- }
-
- }
- -(void)setYoupaipdataArr:(NSArray *)dataArr{
- _youpaipdataArr = dataArr;
- self.youpaiptitleLabel.attributedText = [LCTools setRichTextWithTitle:@"庇护" subTitle:[NSString stringWithFormat:@"(%lu人)",(unsigned long)self.youpaipdataArr.count] titleColor:[UIColor whiteColor] subTitleColor:HexColorFromRGB(0x9F9DA5) titleFontSize:14 subTitleFontSize:12];
-
- }
- @end
|