|
6 | 6 | // Copyright (c) 2014年 Coding. All rights reserved. |
7 | 7 | // |
8 | 8 |
|
9 | | -#define kTweetDetailCell_PadingLeft 55.0 |
| 9 | +#define kTweetDetailCell_PadingLeft 60.0 |
10 | 10 | #define kTweet_TimtFont [UIFont systemFontOfSize:12] |
11 | | -#define kTweetDetailCell_LikeComment_Height 22.0 |
12 | | -#define kTweetDetailCell_LikeComment_Width 44.0 |
| 11 | +#define kTweetDetailCell_LikeComment_Height 27.0 |
| 12 | +#define kTweetDetailCell_LikeComment_Width 50.0 |
13 | 13 | #define kTweetDetailCell_ContentWidth (kScreen_Width - 2*kPaddingLeftWidth) |
14 | 14 | #define kTweetDetailCell_PadingTop 55.0 |
15 | 15 | #define kTweetDetailCell_PadingBottom 10.0 |
@@ -51,25 +51,26 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus |
51 | 51 | self.backgroundColor = [UIColor clearColor]; |
52 | 52 | // self.backgroundColor = [UIColor colorWithHexString:@"0xf3f3f3"]; |
53 | 53 | if (!self.ownerImgView) { |
54 | | - self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 10, 35, 35)]; |
| 54 | + self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 10, 38, 38)]; |
55 | 55 | [self.ownerImgView doCircleFrame]; |
56 | 56 | [self.contentView addSubview:self.ownerImgView]; |
57 | 57 | } |
58 | 58 | if (!self.ownerNameBtn) { |
59 | 59 | self.ownerNameBtn = [UIButton buttonWithUserStyle]; |
60 | | - self.ownerNameBtn.frame = CGRectMake(kTweetDetailCell_PadingLeft, 18, kScreen_Width/2, 20); |
| 60 | + self.ownerNameBtn.frame = CGRectMake(kTweetDetailCell_PadingLeft, CGRectGetMinY(self.ownerImgView.frame), kScreen_Width/2, 20); |
61 | 61 | [self.ownerNameBtn addTarget:self action:@selector(userBtnClicked) forControlEvents:UIControlEventTouchUpInside]; |
62 | 62 | [self.contentView addSubview:self.ownerNameBtn]; |
63 | 63 | } |
64 | | - if (!self.timeClockIconView) { |
65 | | - self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 85, 20, 12, 12)]; |
66 | | - self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"]; |
67 | | - [self.contentView addSubview:self.timeClockIconView]; |
68 | | - } |
| 64 | +// if (!self.timeClockIconView) { |
| 65 | +// self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 85, 20, 12, 12)]; |
| 66 | +// self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"]; |
| 67 | +// [self.contentView addSubview:self.timeClockIconView]; |
| 68 | +// } |
69 | 69 | if (!self.timeLabel) { |
70 | | - self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 18, 70, 12)]; |
| 70 | + self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.ownerNameBtn.frame), CGRectGetMaxY(self.ownerImgView.frame) - 12, kScreen_Width/2, 12)]; |
| 71 | +// self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 18, 70, 12)]; |
71 | 72 | self.timeLabel.font = kTweet_TimtFont; |
72 | | - self.timeLabel.textAlignment = NSTextAlignmentRight; |
| 73 | +// self.timeLabel.textAlignment = NSTextAlignmentRight; |
73 | 74 | self.timeLabel.textColor = [UIColor colorWithHexString:@"0x999999"]; |
74 | 75 | [self.contentView addSubview:self.timeLabel]; |
75 | 76 | } |
@@ -132,7 +133,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus |
132 | 133 | [self.likeUsersView registerClass:[TweetLikeUserCCell class] forCellWithReuseIdentifier:kCCellIdentifier_TweetLikeUser]; |
133 | 134 | self.likeUsersView.dataSource = self; |
134 | 135 | self.likeUsersView.delegate = self; |
135 | | - [self.likeUsersView addLineUp:YES andDown:NO andColor:[UIColor colorWithHexString:@"0xdddddd"]]; |
| 136 | +// [self.likeUsersView addLineUp:YES andDown:NO andColor:[UIColor colorWithHexString:@"0xdddddd"]]; |
136 | 137 | [self.contentView addSubview:self.likeUsersView]; |
137 | 138 | } |
138 | 139 | if (!self.webContentView) { |
@@ -185,10 +186,11 @@ - (void)setTweet:(Tweet *)tweet{ |
185 | 186 | [self.ownerNameBtn setUserTitle:_tweet.owner.name font:self.ownerNameBtn.titleLabel.font maxWidth:(kScreen_Width- kTweetDetailCell_PadingLeft - 85)]; |
186 | 187 |
|
187 | 188 | //发出冒泡的时间 |
188 | | - [self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2]; |
189 | | - CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame); |
190 | | - [self.timeLabel setX:timeLabelX]; |
191 | | - [self.timeClockIconView setX:timeLabelX-15]; |
| 189 | + self.timeLabel.text = [_tweet.created_at stringDisplay_HHmm]; |
| 190 | +// [self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2]; |
| 191 | +// CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame); |
| 192 | +// [self.timeLabel setX:timeLabelX]; |
| 193 | +// [self.timeClockIconView setX:timeLabelX-15]; |
192 | 194 |
|
193 | 195 | //owner冒泡text内容 |
194 | 196 | [self.webContentView setHeight:_tweet.contentHeight]; |
@@ -221,6 +223,7 @@ - (void)setTweet:(Tweet *)tweet{ |
221 | 223 | self.fromLabel.hidden = self.fromPhoneIconView.hidden = _tweet.device.length <= 0; |
222 | 224 |
|
223 | 225 | //喜欢&评论 按钮 |
| 226 | + curBottomY += 5; |
224 | 227 | [self.likeBtn setImage:[UIImage imageNamed:(_tweet.liked.boolValue? @"tweet_btn_liked":@"tweet_btn_like")] forState:UIControlStateNormal]; |
225 | 228 | [self.likeBtn setY:curBottomY]; |
226 | 229 | [self.commentBtn setY:curBottomY]; |
@@ -262,7 +265,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{ |
262 | 265 | cellHeight += kTweetDetailCell_PadingTop; |
263 | 266 | cellHeight += [[self class] contentHeightWithTweet:tweet]; |
264 | 267 | cellHeight += 10; |
265 | | - cellHeight += kTweetDetailCell_LikeComment_Height; |
| 268 | + cellHeight += 5 + kTweetDetailCell_LikeComment_Height; |
266 | 269 | cellHeight += [[self class] locationAndDeviceHeightWithTweet:tweet]; |
267 | 270 | cellHeight += [[self class] likeCommentBtn_BottomPadingWithTweet:tweet]; |
268 | 271 | cellHeight += [[self class] likeUsersHeightWithTweet:tweet]; |
|
0 commit comments