@@ -48,10 +48,8 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4848 }
4949 if (!_ownerIconView) {
5050 CGFloat borderWidth = 2 ;
51-
5251 UIView *bgView = [[UIView alloc ] initWithFrame: CGRectMake (kPaddingLeftWidth - borderWidth, curBottomY, 28 + 2 *borderWidth, 28 + 2 *borderWidth)];
5352 bgView.backgroundColor = kColorTableBG ;
54-
5553 _ownerIconView = [[UIImageView alloc ] initWithFrame: CGRectMake (0 , 0 , 28 , 28 )];
5654 _ownerIconView.layer .masksToBounds = YES ;
5755 _ownerIconView.layer .cornerRadius = _ownerIconView.frame .size .width /2 ;
@@ -61,7 +59,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
6159 make.width .height .mas_equalTo (28.0 );
6260 make.center .equalTo (bgView);
6361 }];
64-
6562 [self .contentView addSubview: bgView];
6663 }
6764 if (!_contentLabel) {
@@ -106,7 +103,6 @@ - (void)setCurComment:(ProjectLineNote *)curComment{
106103 }
107104 CGFloat curBottomY = 15 ;
108105 [_ownerIconView sd_setImageWithURL: [_curComment.author.avatar urlImageWithCodePathResizeToView: _ownerIconView] placeholderImage: kPlaceholderMonkeyRoundWidth (33.0 )];
109-
110106 NSString *contentStr = _curComment.content ;
111107 [_contentLabel setLongString: contentStr withFitWidth: kTaskCommentCell_ContentWidth ];
112108 for (HtmlMediaItem *item in _curComment.htmlMedia .mediaItems ) {
@@ -120,18 +116,18 @@ - (void)setCurComment:(ProjectLineNote *)curComment{
120116 self.imageCollectionView .hidden = NO ;
121117 [self .imageCollectionView setFrame: CGRectMake (kTaskCommentCell_LeftContentPading , curBottomY, kTaskCommentCell_ContentWidth , [DynamicCommentCell imageCollectionViewHeightWithCount: imagesCount])];
122118 [self .imageCollectionView reloadData ];
123- }else {
119+ } else {
124120 self.imageCollectionView .hidden = YES ;
125121 }
126122 curBottomY += [DynamicCommentCell imageCollectionViewHeightWithCount: imagesCount];
127123 [_timeLabel setY: curBottomY];
128124 _timeLabel.text = [NSString stringWithFormat: @" %@ 发布于 %@ " , _curComment.author.name,[_curComment.created_at stringDisplay_HHmm ]];
129125}
130126
131- - (void )configTop : (BOOL )isTop andBottom : (BOOL )isBottom {
127+ - (void )configTop : (BOOL )isTop andBottom : (BOOL )isBottom {
132128 if (isTop && isBottom) {
133129 _timeLineView.hidden = YES ;
134- }else {
130+ } else {
135131 _timeLineView.hidden = NO ;
136132 [_timeLineView mas_remakeConstraints: ^(MASConstraintMaker *make) {
137133 make.width .mas_equalTo (2.0 );
@@ -142,7 +138,7 @@ - (void)configTop:(BOOL)isTop andBottom:(BOOL)isBottom{
142138 }
143139}
144140
145- + (CGFloat)cellHeightWithObj : (id )obj {
141+ + (CGFloat)cellHeightWithObj : (id )obj {
146142 CGFloat cellHeight = 0 ;
147143 if ([obj isKindOfClass: [ProjectLineNote class ]]) {
148144 ProjectLineNote *curComment = (ProjectLineNote *)obj;
@@ -154,7 +150,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{
154150 return cellHeight;
155151}
156152
157- + (CGFloat)imageCollectionViewHeightWithCount : (NSInteger )countNum {
153+ + (CGFloat)imageCollectionViewHeightWithCount : (NSInteger )countNum {
158154 if (countNum <= 0 ) {
159155 return 0 ;
160156 }
@@ -163,7 +159,6 @@ + (CGFloat)imageCollectionViewHeightWithCount:(NSInteger)countNum{
163159 return (43 *numOfline);
164160}
165161
166-
167162#pragma mark Collection M
168163- (NSInteger )collectionView : (UICollectionView *)collectionView numberOfItemsInSection : (NSInteger )section {
169164 return _curComment.htmlMedia .imageItems .count ;
0 commit comments