Skip to content

Commit aaff55f

Browse files
committed
调整标签大小,换图片
1 parent 7729059 commit aaff55f

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

Coding_iOS/Controllers/EditTopicViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ - (void)loadEditView
155155
if (self.type != TopicEditTypeFeedBack) {
156156
_labelAddBtn = [[UIButton alloc] initWithFrame:CGRectZero];
157157
[_labelAddBtn setImage:[UIImage imageNamed:@"tag_add"] forState:UIControlStateNormal];
158-
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(14, 14, 14, 14)];
158+
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(12, 12, 12, 12)];
159159
[_labelAddBtn addTarget:self action:@selector(addtitleBtnClick) forControlEvents:UIControlEventTouchUpInside];
160160
[_editView addSubview:_labelAddBtn];
161161
}
@@ -221,7 +221,7 @@ - (void)loadEditView
221221
}];
222222

223223
[_labelAddBtn mas_makeConstraints:^(MASConstraintMaker *make) {
224-
make.top.equalTo(_labelView.mas_top).offset(-12.0);
224+
make.top.equalTo(_labelView.mas_top).offset(-10);
225225
make.right.equalTo(_editView);
226226

227227
make.width.mas_equalTo(44);
241 Bytes
Loading
143 Bytes
Loading

Coding_iOS/Views/Cell/TopicContentCell.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5959
if (!_labelAddBtn) {
6060
_labelAddBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreen_Width-44, 0, 44, 44)];
6161
[_labelAddBtn setImage:[UIImage imageNamed:@"tag_add"] forState:UIControlStateNormal];
62-
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(14, 14, 14, 14)];
62+
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(12, 12, 12, 12)];
6363
[_labelAddBtn addTarget:self action:@selector(addtitleBtnClick) forControlEvents:UIControlEventTouchUpInside];
6464
[self.contentView addSubview:_labelAddBtn];
6565
}
@@ -140,14 +140,14 @@ - (void)setCurTopic:(ProjectTopic *)curTopic
140140
if (_labelView) {
141141
[_labelView removeFromSuperview];
142142
}
143-
_labelView = [[ProjectTopicLabelView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 0, curWidth, 20) projectTopic:_curTopic md:NO];
143+
_labelView = [[ProjectTopicLabelView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 0, curWidth, 24) projectTopic:_curTopic md:NO];
144144
__weak typeof(self) weakSelf = self;
145145
_labelView.delLabelBlock = ^(NSInteger index) {
146146
[weakSelf delBtnClick:index];
147147
};
148148
[self.contentView insertSubview:_labelView belowSubview:_labelAddBtn];
149149

150-
[_labelAddBtn setY:curBottomY - 11];
150+
[_labelAddBtn setY:curBottomY - 10];
151151
[_labelView setY:curBottomY];
152152
[_labelView setHeight:_labelView.labelH];
153153
//_labelAddBtn.hidden = [_curTopic canEdit] ? FALSE : TRUE;
@@ -216,7 +216,7 @@ + (CGFloat)cellHeightWithObj:(id)obj
216216
CGFloat curWidth = kScreen_Width -2*kPaddingLeftWidth;
217217
cellHeight += 8 + [topic.title getHeightWithFont:kTopicContentCell_FontTitle constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 16 + 20;
218218

219-
CGFloat labelH = 20;
219+
CGFloat labelH = 24;
220220
if (topic.labels.count > 0) {
221221
CGFloat x = 0.0f;
222222
CGFloat y = 0.0f;
@@ -230,14 +230,14 @@ + (CGFloat)cellHeightWithObj:(id)obj
230230
tLbl.text = label.name;
231231
[tLbl sizeToFit];
232232

233-
CGFloat width = tLbl.frame.size.width + 20;
233+
CGFloat width = tLbl.frame.size.width + 30;
234234
if (x + width > limitW) {
235-
y += 26.0f;
235+
y += 30.0f;
236236
x = 0.0f;
237237
}
238238
x += width;
239239
}
240-
labelH = y + 20;
240+
labelH = y + 24;
241241
}
242242
//cellHeight += labelH + 24;
243243
cellHeight += labelH + 3;

Coding_iOS/Views/Cell/TopicPreviewCell.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5858
if (!_labelAddBtn) {
5959
_labelAddBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreen_Width-44, 0, 44, 44)];
6060
[_labelAddBtn setImage:[UIImage imageNamed:@"tag_add"] forState:UIControlStateNormal];
61-
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(14, 14, 14, 14)];
61+
[_labelAddBtn setImageEdgeInsets:UIEdgeInsetsMake(12, 12, 12, 12)];
6262
[_labelAddBtn addTarget:self action:@selector(addtitleBtnClick:) forControlEvents:UIControlEventTouchUpInside];
6363
[self.contentView addSubview:_labelAddBtn];
6464
}
@@ -138,14 +138,14 @@ - (void)setCurTopic:(ProjectTopic *)curTopic
138138
if (_labelView) {
139139
[_labelView removeFromSuperview];
140140
}
141-
_labelView = [[ProjectTopicLabelView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 0, curWidth, 20) projectTopic:_curTopic md:YES];
141+
_labelView = [[ProjectTopicLabelView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 0, curWidth, 24) projectTopic:_curTopic md:YES];
142142
[self.contentView insertSubview:_labelView belowSubview:_labelAddBtn];
143143
__weak typeof(self) weakSelf = self;
144144
_labelView.delLabelBlock = ^(NSInteger index) {
145145
[weakSelf delBtnClick:index];
146146
};
147147

148-
[_labelAddBtn setY:curBottomY - 11];
148+
[_labelAddBtn setY:curBottomY - 10];
149149
[_labelView setY:curBottomY];
150150
[_labelView setHeight:_labelView.labelH];
151151

@@ -214,7 +214,7 @@ + (CGFloat)cellHeightWithObjWithLabel:(id)obj
214214
CGFloat curWidth = kScreen_Width -2*kPaddingLeftWidth;
215215
cellHeight += 8 + [topic.title getHeightWithFont:kTopicContentCell_FontTitle constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 16 + 20;
216216

217-
CGFloat labelH = 20;
217+
CGFloat labelH = 24;
218218
if (topic.mdLabels.count > 0) {
219219
CGFloat x = 0.0f;
220220
CGFloat y = 0.0f;
@@ -228,14 +228,14 @@ + (CGFloat)cellHeightWithObjWithLabel:(id)obj
228228
tLbl.text = label.name;
229229
[tLbl sizeToFit];
230230

231-
CGFloat width = tLbl.frame.size.width + 20;
231+
CGFloat width = tLbl.frame.size.width + 30;
232232
if (x + width > limitW) {
233-
y += 26.0f;
233+
y += 30.0f;
234234
x = 0.0f;
235235
}
236236
x += width;
237237
}
238-
labelH = y + 20;
238+
labelH = y + 24;
239239
}
240240
//cellHeight += labelH + 24;
241241
cellHeight += labelH + 3;

Coding_iOS/Views/ProjectTopicLabelView.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ - (id)initWithFrame:(CGRect)frame projectTopic:(ProjectTopic *)topic md:(BOOL)is
2121
{
2222
self = [super initWithFrame:frame];
2323
if (self) {
24-
_labelH = 20;
24+
_labelH = 24;
2525
NSArray *labelAry = isMD ? topic.mdLabels : topic.labels;
2626
if (labelAry.count > 0) {
2727
CGFloat x = 0.0f;
@@ -40,24 +40,24 @@ - (id)initWithFrame:(CGRect)frame projectTopic:(ProjectTopic *)topic md:(BOOL)is
4040

4141
[tLbl sizeToFit];
4242

43-
CGFloat width = tLbl.frame.size.width + 20;
43+
CGFloat width = tLbl.frame.size.width + 30;
4444
if (x + width > limitW) {
45-
y += 26.0f;
45+
y += 30.0f;
4646
x = 0.0f;
4747
}
48-
[tLbl setFrame:CGRectMake(x, y, width - 4, 20)];
48+
[tLbl setFrame:CGRectMake(x, y, width - 4, 24)];
4949
x += width;
5050

5151
[self addSubview:tLbl];
5252
}
53-
_labelH = y + 20;
53+
_labelH = y + 24;
5454
} else {
55-
UIImageView *iconImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 2, 15, 15)];
55+
UIImageView *iconImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, (_labelH - 20) * 0.5, 20, 20)];
5656
[iconImg setImage:[UIImage imageNamed:@"tag_icon"]];
5757

58-
UILabel *tLbl = [[UILabel alloc] initWithFrame:CGRectMake(20, 2, 30, 15)];
58+
UILabel *tLbl = [[UILabel alloc] initWithFrame:CGRectMake(25, (_labelH - 20) * 0.5, 40, 20)];
5959

60-
tLbl.font = [UIFont systemFontOfSize:14];
60+
tLbl.font = [UIFont systemFontOfSize:15];
6161
tLbl.text = @"标签";
6262
tLbl.textColor = [UIColor colorWithHexString:@"0x3bbd79"];
6363

0 commit comments

Comments
 (0)