diff options
author | Vitaly Takmazov | 2014-02-03 16:51:47 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2014-02-03 16:51:47 +0400 |
commit | 57c8c45a4730fe7c980b8b7eadf94ca60b97db43 (patch) | |
tree | 162041af6bd2f3d8f383cf9842a356c07068f04c /Juick/MessageCell.m | |
parent | 4fd723c665a2b828447fcc9476c752803f76ea35 (diff) |
Still fighting with scroll :(
Diffstat (limited to 'Juick/MessageCell.m')
-rw-r--r-- | Juick/MessageCell.m | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/Juick/MessageCell.m b/Juick/MessageCell.m index d2b2983..d47c3d2 100644 --- a/Juick/MessageCell.m +++ b/Juick/MessageCell.m @@ -57,7 +57,7 @@ [self.summaryLabel setTextAlignment:NSTextAlignmentLeft]; [self.summaryLabel setTextColor:[UIColor grayColor]]; [self.summaryLabel setBackgroundColor:[UIColor clearColor]]; - self.attach = [[UIImageView alloc]initWithImage:[UIImage imageWithImage:[UIImage imageNamed:@"AttachPlaceholder.png"] convertToWidth:300.0f]]; + self.attach = [[UIImageView alloc] initWithFrame:CGRectZero]; [self.attach setBackgroundColor:[UIColor clearColor]]; self.attach.contentMode = UIViewContentModeTopLeft; @@ -152,7 +152,6 @@ - (void) setMessage:(Message *)msg { _message = msg; [self.avatar setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://i.juick.com/as/%d.png", [msg.userID intValue]]] placeholderImage:[UIImage imageNamed:@"0.png"] options:SDWebImageContinueInBackground]; - __weak MessageCell *weakSelf = self; self.titleLabel.text = msg.user; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; @@ -173,21 +172,17 @@ self.bodyLabel.text = [[NSString alloc] initWithFormat:@"%@\n%@", [msg.tags componentsJoinedByString:@", "], [msg.text stringByDecodingHTMLEntities]]; } - if ([msg.attach length] > 0) { - SDWebImageManager * manager = [SDWebImageManager sharedManager]; - [manager downloadWithURL:[NSURL URLWithString:msg.attach] options:SDWebImageContinueInBackground progress:^(NSUInteger receivedSize, long long expectedSize) { - // <#code#> - } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) { - self.attach.image = [UIImage imageWithImage:image convertToWidth:300.0f]; - [self setNeedsLayout]; - [self layoutIfNeeded]; - }]; - } else { - self.attach.image = nil; - } [self setNeedsLayout]; } +- (UITableView *) getTable { + id view = [self superview]; + while ([view isKindOfClass:[UITableView class]] == NO) { + view = [view superview]; + } + return (UITableView *)view; +} + - (void) attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url { [[UIApplication sharedApplication] openURL:url]; } |