-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathTaskCommentCCell.m
50 lines (42 loc) · 1.37 KB
/
TaskCommentCCell.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// TaskCommentCCell.m
// Coding_iOS
//
// Created by Ease on 15/3/30.
// Copyright (c) 2015年 Coding. All rights reserved.
//
#define kTaskCommentCCell_Width 33.0
#import "TaskCommentCCell.h"
@implementation TaskCommentCCell
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)setCurMediaItem:(HtmlMediaItem *)curMediaItem{
if (!_imgView) {
_imgView = [[YLImageView alloc] initWithFrame:CGRectZero];
_imgView.contentMode = UIViewContentModeScaleAspectFill;
_imgView.clipsToBounds = YES;
_imgView.layer.masksToBounds = YES;
_imgView.layer.cornerRadius = 2.0;
[self.contentView addSubview:_imgView];
[_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
}
if (_curMediaItem != curMediaItem) {
_curMediaItem = curMediaItem;
[self.imgView sd_setImageWithURL:[_curMediaItem.src urlImageWithCodePathResize:2*kTaskCommentCCell_Width crop:YES] placeholderImage:kPlaceholderCodingSquareWidth(55.0) options:SDWebImageRetryFailed| SDWebImageLowPriority| SDWebImageHandleCookies];
}
}
- (void)layoutSubviews{
[super layoutSubviews];
}
+(CGSize)ccellSize{
return CGSizeMake(kTaskCommentCCell_Width, kTaskCommentCCell_Width);
}
@end