Skip to content

Commit f54a0db

Browse files
committed
UI调整
1 parent 6e102db commit f54a0db

2 files changed

Lines changed: 24 additions & 17 deletions

File tree

Coding_iOS/Models/Projects.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ - (NSString *)localMembersPath{
130130
- (NSString *)toBranchOrTagPath:(NSString *)path{
131131
return [NSString stringWithFormat:@"api/user/%@/project/%@/git/%@", self.owner_user_name, self.name, path];
132132
}
133+
- (NSString *)description_mine{
134+
if (_description_mine && _description_mine.length > 0) {
135+
return _description_mine;
136+
}else{
137+
return @"未填写";
138+
}
139+
}
133140
@end
134141

135142

Coding_iOS/Views/Cell/ProjectListTaCell.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright (c) 2015年 Coding. All rights reserved.
77
//
88

9+
#define kProjectListTaCell_IconWidth 55
10+
911
#import "ProjectListTaCell.h"
1012

1113
@interface ProjectListTaCell ()
@@ -43,13 +45,13 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4345
if (!_nameL) {
4446
_nameL = [[UILabel alloc] init];
4547
_nameL.textColor = [UIColor colorWithHexString:@"0x222222"];
46-
_nameL.font = [UIFont systemFontOfSize:17];
48+
_nameL.font = [UIFont systemFontOfSize:16];
4749
[self.contentView addSubview:_nameL];
4850
}
4951
if (!_desL) {
5052
_desL = [[UILabel alloc] init];
5153
_desL.textColor = [UIColor colorWithHexString:@"0x999999"];
52-
_desL.font = [UIFont systemFontOfSize:15];
54+
_desL.font = [UIFont systemFontOfSize:14];
5355
[self.contentView addSubview:_desL];
5456
}
5557
if (!_starL) {
@@ -70,51 +72,47 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
7072
_forkL.font = [UIFont systemFontOfSize:10];
7173
[self.contentView addSubview:_forkL];
7274
}
73-
// _starL.adjustsFontSizeToFitWidth = _watchL.adjustsFontSizeToFitWidth = _forkL.adjustsFontSizeToFitWidth = YES;
74-
// _starL.minimumScaleFactor = _watchL.minimumScaleFactor = _forkL.minimumScaleFactor = 0.6;
7575
_starV.image = [UIImage imageNamed:@"git_icon_star"];
7676
_watchV.image = [UIImage imageNamed:@"git_icon_watch"];
7777
_forkV.image = [UIImage imageNamed:@"git_icon_fork"];
7878

7979
[_iconV mas_makeConstraints:^(MASConstraintMaker *make) {
80-
make.size.mas_equalTo(CGSizeMake(55, 55));
80+
make.size.mas_equalTo(CGSizeMake(kProjectListTaCell_IconWidth, kProjectListTaCell_IconWidth));
8181
make.left.equalTo(self.contentView).offset(kPaddingLeftWidth);
8282
make.centerY.equalTo(self.contentView);
8383
}];
8484
[_nameL mas_makeConstraints:^(MASConstraintMaker *make) {
8585
make.height.mas_equalTo(20);
86-
make.top.equalTo(_iconV);
8786
make.left.equalTo(_iconV.mas_right).offset(20);
8887
make.right.equalTo(self.contentView);
88+
make.bottom.equalTo(_desL.mas_top).offset(-5);
8989
}];
9090
[_desL mas_makeConstraints:^(MASConstraintMaker *make) {
91-
make.height.mas_equalTo(20);
91+
make.height.mas_equalTo(15);
9292
make.left.right.equalTo(_nameL);
93-
make.centerY.equalTo(_iconV);
93+
make.bottom.equalTo(_starV.mas_top).offset(-5);
9494
}];
9595
[_starV mas_makeConstraints:^(MASConstraintMaker *make) {
96-
make.left.equalTo(_nameL);
9796
make.bottom.equalTo(_iconV);
97+
make.left.equalTo(_nameL);
9898
make.centerY.equalTo(@[_starL, _watchV, _watchL, _forkV, _forkL]);
9999
make.width.height.equalTo(@[_watchV, _forkV, @12]);
100100
}];
101-
CGFloat splitWidth = 2;
102101
[_starL mas_makeConstraints:^(MASConstraintMaker *make) {
103-
make.left.equalTo(_starV.mas_right).offset(splitWidth);
102+
make.left.equalTo(_starV.mas_right).offset(2);
104103
make.height.equalTo(@[_starV, _watchL, _forkL]);
105-
// make.width.equalTo(@[_watchL, _forkL, @25]);
106104
}];
107105
[_watchV mas_makeConstraints:^(MASConstraintMaker *make) {
108-
make.left.equalTo(_starL.mas_right).offset(splitWidth);
106+
make.left.equalTo(_starL.mas_right).offset(10);
109107
}];
110108
[_watchL mas_makeConstraints:^(MASConstraintMaker *make) {
111-
make.left.equalTo(_watchV.mas_right).offset(splitWidth);
109+
make.left.equalTo(_watchV.mas_right).offset(2);
112110
}];
113111
[_forkV mas_makeConstraints:^(MASConstraintMaker *make) {
114-
make.left.equalTo(_watchL.mas_right).offset(splitWidth);
112+
make.left.equalTo(_watchL.mas_right).offset(10);
115113
}];
116114
[_forkL mas_makeConstraints:^(MASConstraintMaker *make) {
117-
make.left.equalTo(_forkV.mas_right).offset(splitWidth);
115+
make.left.equalTo(_forkV.mas_right).offset(2);
118116
}];
119117

120118
}
@@ -126,7 +124,9 @@ - (void)setProject:(Project *)project{
126124
if (!_project) {
127125
return;
128126
}
129-
[_iconV sd_setImageWithURL:[_project.icon urlImageWithCodePathResizeToView:_iconV] placeholderImage:kPlaceholderCodingSquareWidth(55.0)];
127+
[_iconV sd_setImageWithURL:[_project.icon urlImageWithCodePathResize:2*kProjectListTaCell_IconWidth] placeholderImage:kPlaceholderCodingSquareWidth(55.0) completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
128+
NSLog(@"_project: %@, imageURL: %@", _project.name, imageURL.absoluteString);
129+
}];
130130
_nameL.text = _project.name;
131131
_desL.text = _project.description_mine;
132132
_starL.text = _project.star_count.stringValue;

0 commit comments

Comments
 (0)