19
19
@interface TopicCommentCell ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
20
20
@property (strong , nonatomic ) UIImageView *ownerIconView;
21
21
@property (strong , nonatomic ) UIView *bestAnswerV;
22
- @property (strong , nonatomic ) UIButton *voteBtn;
22
+ @property (strong , nonatomic ) UIButton *voteBtn, *voteBtnBig ;
23
23
@property (strong , nonatomic ) UILabel *timeLabel;
24
24
@property (strong , nonatomic ) UICustomCollectionView *imageCollectionView;
25
25
@end
@@ -64,6 +64,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
64
64
_voteBtn.titleLabel .font = [UIFont systemFontOfSize: 11 ];
65
65
[_voteBtn addTarget: self action: @selector (voteBtnClicked ) forControlEvents: UIControlEventTouchUpInside];
66
66
[self .contentView addSubview: _voteBtn];
67
+
68
+ _voteBtnBig = [[UIButton alloc ] initWithFrame: CGRectInset (_voteBtn.frame, -10 , -5 )];
69
+ [_voteBtnBig addTarget: self action: @selector (voteBtnClicked ) forControlEvents: UIControlEventTouchUpInside];
70
+ [self .contentView insertSubview: _voteBtnBig belowSubview: _voteBtn];
67
71
}
68
72
CGFloat curWidth = kScreen_Width - 40 - 2 *kPaddingLeftWidth ;
69
73
if (!_contentLabel) {
@@ -109,7 +113,7 @@ - (void)voteBtnClicked{
109
113
}
110
114
111
115
- (void )setVoteCount : (NSNumber *)voteCount isVoted : (BOOL )isVoted {
112
- [_voteBtn setBackgroundColor: [UIColor colorWithHexString: isVoted? @" 0x2FAEEA " : @" 0xFFFFFF" ]];
116
+ [_voteBtn setBackgroundColor: [UIColor colorWithHexString: isVoted? @" 0x3BBD79 " : @" 0xFFFFFF" ]];
113
117
[_voteBtn setTitleColor: [UIColor colorWithHexString: isVoted? @" 0xFFFFFF" : @" 0x666666" ] forState: UIControlStateNormal];
114
118
[_voteBtn setTitle: [NSString stringWithFormat: @" +%@ " , voteCount] forState: UIControlStateNormal];
115
119
}
@@ -130,6 +134,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
130
134
131
135
_ownerIconView.y = _contentLabel.y = curBottomY;
132
136
_voteBtn.y = _ownerIconView.bottom + 5 ;
137
+ _voteBtnBig.y = _voteBtn.y - 5 ;
133
138
[self setVoteCount: _toComment.up_vote_counts isVoted: _toComment.is_up_voted.boolValue];
134
139
[_ownerIconView sd_setImageWithURL: [_toComment.owner.avatar urlImageWithCodePathResizeToView: _ownerIconView] placeholderImage: kPlaceholderMonkeyRoundView (_ownerIconView)];
135
140
[_contentLabel setLongString: _toComment.content withFitWidth: curWidth];
@@ -158,7 +163,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
158
163
159
164
- (void )setIsAnswer : (BOOL )isAnswer {
160
165
_isAnswer = isAnswer;
161
- _ownerIconView.hidden = _voteBtn.hidden = !_isAnswer;
166
+ _ownerIconView.hidden = _voteBtn.hidden = _voteBtnBig. hidden = !_isAnswer;
162
167
_contentLabel.textColor = [UIColor colorWithHexString: _isAnswer? @" 0x222222" : @" 0x666666" ];
163
168
}
164
169
0 commit comments