Commit e56684ef1d0885ae4ff9bedacb5b9505b5ff05de
1 parent
0a4657fc
no message
Showing
1 changed file
with
8 additions
and
6 deletions
CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCell.m
| @@ -22,6 +22,8 @@ | @@ -22,6 +22,8 @@ | ||
| 22 | @end | 22 | @end |
| 23 | 23 | ||
| 24 | @implementation CNLiveNotSeeCell | 24 | @implementation CNLiveNotSeeCell |
| 25 | +static const NSInteger margin = 15; | ||
| 26 | + | ||
| 25 | - (instancetype)initWithFrame:(CGRect)frame { | 27 | - (instancetype)initWithFrame:(CGRect)frame { |
| 26 | self = [super initWithFrame:frame]; | 28 | self = [super initWithFrame:frame]; |
| 27 | if (self) { | 29 | if (self) { |
| @@ -65,6 +67,7 @@ | @@ -65,6 +67,7 @@ | ||
| 65 | 67 | ||
| 66 | } | 68 | } |
| 67 | } | 69 | } |
| 70 | + | ||
| 68 | - (void)configSubviews { | 71 | - (void)configSubviews { |
| 69 | [self.contentView addSubview:self.avatarImage]; | 72 | [self.contentView addSubview:self.avatarImage]; |
| 70 | [self.contentView addSubview:self.nameLabel]; | 73 | [self.contentView addSubview:self.nameLabel]; |
| @@ -72,26 +75,25 @@ | @@ -72,26 +75,25 @@ | ||
| 72 | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPress:)]; | 75 | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPress:)]; |
| 73 | longPress.minimumPressDuration = 1; | 76 | longPress.minimumPressDuration = 1; |
| 74 | [self.contentView addGestureRecognizer:longPress]; | 77 | [self.contentView addGestureRecognizer:longPress]; |
| 75 | - | ||
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | #pragma mark - Layout | 80 | #pragma mark - Layout |
| 79 | - (void)xw_layoutSubviews { | 81 | - (void)xw_layoutSubviews { |
| 80 | [self.avatarImage mas_makeConstraints:^(MASConstraintMaker *make) { | 82 | [self.avatarImage mas_makeConstraints:^(MASConstraintMaker *make) { |
| 81 | - make.top.mas_equalTo(self.contentView).offset(15); | 83 | + make.top.mas_equalTo(self.contentView).offset(margin); |
| 82 | make.centerX.mas_equalTo(self.contentView); | 84 | make.centerX.mas_equalTo(self.contentView); |
| 83 | make.size.mas_equalTo(CGSizeMake(45, 45)); | 85 | make.size.mas_equalTo(CGSizeMake(45, 45)); |
| 84 | }]; | 86 | }]; |
| 85 | 87 | ||
| 86 | [self.delButton mas_makeConstraints:^(MASConstraintMaker *make) { | 88 | [self.delButton mas_makeConstraints:^(MASConstraintMaker *make) { |
| 87 | - make.top.mas_equalTo(self.contentView).offset(2.5);; | 89 | + make.top.mas_equalTo(self.contentView).offset(3);; |
| 88 | make.right.mas_equalTo(self.avatarImage.mas_left).offset(12.5); | 90 | make.right.mas_equalTo(self.avatarImage.mas_left).offset(12.5); |
| 89 | - make.size.mas_equalTo(CGSizeMake(30, 30)); | 91 | + make.size.mas_equalTo(CGSizeMake(20, 20)); |
| 90 | }]; | 92 | }]; |
| 91 | 93 | ||
| 92 | [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | 94 | [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 93 | make.centerX.mas_equalTo(self.contentView); | 95 | make.centerX.mas_equalTo(self.contentView); |
| 94 | - make.bottom.mas_equalTo(self.contentView).offset(-15); | 96 | + make.bottom.mas_equalTo(self.contentView).offset(-margin); |
| 95 | make.left.and.right.mas_lessThanOrEqualTo(self.contentView); | 97 | make.left.and.right.mas_lessThanOrEqualTo(self.contentView); |
| 96 | }]; | 98 | }]; |
| 97 | 99 | ||
| @@ -101,7 +103,7 @@ | @@ -101,7 +103,7 @@ | ||
| 101 | if (!_delButton) { | 103 | if (!_delButton) { |
| 102 | _delButton = [UIButton buttonWithType:UIButtonTypeCustom]; | 104 | _delButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 103 | UIImage *image = [self getImageWithImageName:@"privacy_edit_minus" bundleName:@"CNLiveSettingModule" targetClass:[self class]]; | 105 | UIImage *image = [self getImageWithImageName:@"privacy_edit_minus" bundleName:@"CNLiveSettingModule" targetClass:[self class]]; |
| 104 | - [_delButton setImage:image forState:UIControlStateNormal]; | 106 | + [_delButton setBackgroundImage:image forState:UIControlStateNormal]; |
| 105 | [_delButton addTarget:self action:@selector(delButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | 107 | [_delButton addTarget:self action:@selector(delButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside]; |
| 106 | [_delButton setHidden:YES]; | 108 | [_delButton setHidden:YES]; |
| 107 | 109 |