| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- //
- // ReleaseTopicCell.m
- // BuguLive
- //
- // Created by bugu on 2019/11/28.
- // Copyright © 2019 xfg. All rights reserved.
- //
- #import "ReleaseTopicCell.h"
- @implementation ReleaseTopicCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- [self initViews];
- }
- return self;
- }
- - (void)initViews{
-
- self.topicLabel = [[UILabel alloc]init];
- self.topicLabel.textColor = [UIColor colorWithHexString:@"#333333"];
- self.topicLabel.font = [UIFont systemFontOfSize:14];
-
- self.numLabel = [[UILabel alloc]init];
- self.numLabel.textColor = [UIColor colorWithHexString:@"#666666"];
- self.numLabel.font = [UIFont systemFontOfSize:14];
-
- self.topicLabel.text = @"#xxxxxxx#";
-
- self.numLabel.text = @"xxxxxxx";
-
- [self.contentView addSubview: self.topicLabel];
- [self.contentView addSubview: self.numLabel];
- }
- - (void)layoutSubviews {
- [super layoutSubviews];
-
- [self.topicLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.centerY.equalTo(self);
- }];
-
- [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-10);
- make.centerY.equalTo(self);
- }];
- }
- - (void)setTopic:(MGDynamicTopicModel *)topic
- {
- self.topicLabel.text = [NSString stringWithFormat:@"#%@#",topic.name];
- self.numLabel.text = [NSString stringWithFormat:ASLocalizedString(@"%@人讨论"),topic.num];
- }
- @end
|