1919@interface TopicCommentCell ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
2020@property (strong , nonatomic ) UIImageView *ownerIconView;
2121@property (strong , nonatomic ) UIView *bestAnswerV;
22- @property (strong , nonatomic ) UIButton *voteBtn;
22+ @property (strong , nonatomic ) UIButton *voteBtn, *voteBtnBig ;
2323@property (strong , nonatomic ) UILabel *timeLabel;
2424@property (strong , nonatomic ) UICustomCollectionView *imageCollectionView;
2525@end
@@ -64,6 +64,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
6464 _voteBtn.titleLabel .font = [UIFont systemFontOfSize: 11 ];
6565 [_voteBtn addTarget: self action: @selector (voteBtnClicked ) forControlEvents: UIControlEventTouchUpInside];
6666 [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];
6771 }
6872 CGFloat curWidth = kScreen_Width - 40 - 2 *kPaddingLeftWidth ;
6973 if (!_contentLabel) {
@@ -109,7 +113,7 @@ - (void)voteBtnClicked{
109113}
110114
111115- (void )setVoteCount : (NSNumber *)voteCount isVoted : (BOOL )isVoted {
112- [_voteBtn setBackgroundColor: [UIColor colorWithHexString: isVoted? @" 0x2FAEEA " : @" 0xFFFFFF" ]];
116+ [_voteBtn setBackgroundColor: [UIColor colorWithHexString: isVoted? @" 0x3BBD79 " : @" 0xFFFFFF" ]];
113117 [_voteBtn setTitleColor: [UIColor colorWithHexString: isVoted? @" 0xFFFFFF" : @" 0x666666" ] forState: UIControlStateNormal];
114118 [_voteBtn setTitle: [NSString stringWithFormat: @" +%@ " , voteCount] forState: UIControlStateNormal];
115119}
@@ -130,6 +134,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
130134
131135 _ownerIconView.y = _contentLabel.y = curBottomY;
132136 _voteBtn.y = _ownerIconView.bottom + 5 ;
137+ _voteBtnBig.y = _voteBtn.y - 5 ;
133138 [self setVoteCount: _toComment.up_vote_counts isVoted: _toComment.is_up_voted.boolValue];
134139 [_ownerIconView sd_setImageWithURL: [_toComment.owner.avatar urlImageWithCodePathResizeToView: _ownerIconView] placeholderImage: kPlaceholderMonkeyRoundView (_ownerIconView)];
135140 [_contentLabel setLongString: _toComment.content withFitWidth: curWidth];
@@ -158,7 +163,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
158163
159164- (void )setIsAnswer : (BOOL )isAnswer {
160165 _isAnswer = isAnswer;
161- _ownerIconView.hidden = _voteBtn.hidden = !_isAnswer;
166+ _ownerIconView.hidden = _voteBtn.hidden = _voteBtnBig. hidden = !_isAnswer;
162167 _contentLabel.textColor = [UIColor colorWithHexString: _isAnswer? @" 0x222222" : @" 0x666666" ];
163168}
164169
0 commit comments