Skip to content

Commit 9be234a

Browse files
committed
猴子头不要背景了
1 parent 46cb9ab commit 9be234a

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Coding_iOS/Views/CCell/MessageMediaItemCCell.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
@property (strong, nonatomic) YLImageView *imgView;
2323

2424
+(CGSize)ccellSizeWithObj:(NSObject *)obj;
25-
+(CGSize)singleCcellSize;
25+
+(CGSize)monkeyCcellSize;
2626

2727
@end

Coding_iOS/Views/CCell/MessageMediaItemCCell.m

+4-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ - (void)setCurObj:(NSObject *)curObj{
6363

6464
CGSize reSize = CGSizeZero;
6565
if ([self.reuseIdentifier isEqualToString:kCCellIdentifier_MessageMediaItem_Single]) {
66-
reSize = [MessageMediaItemCCell singleCcellSize];
66+
reSize = [MessageMediaItemCCell monkeyCcellSize];
6767
}else{
6868
reSize = [MessageMediaItemCCell ccellSizeWithObj:_curObj];
6969
}
@@ -84,8 +84,9 @@ +(CGSize)ccellSizeWithObj:(NSObject *)obj{
8484
return itemSize;
8585
}
8686

87-
+(CGSize)singleCcellSize{
88-
return CGSizeMake(100, 100);
87+
+(CGSize)monkeyCcellSize{
88+
CGFloat width = kScaleFrom_iPhone5_Desgin(100);
89+
return CGSizeMake(width, width);
8990
}
9091

9192
- (void)layoutSubviews{

Coding_iOS/Views/Cell/MessageCell.m

+7-5
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
174174
// 有图片
175175
[_contentLabel setY:2*kMessageCell_PadingHeight + mediaViewHeight];
176176

177-
CGFloat contentWidth = [_curPriMsg isSingleBigMonkey]? [MessageMediaItemCCell singleCcellSize].width : kMessageCell_ContentWidth;
177+
CGFloat contentWidth = [_curPriMsg isSingleBigMonkey]? [MessageMediaItemCCell monkeyCcellSize].width : kMessageCell_ContentWidth;
178178
bgImgViewSize = CGSizeMake(contentWidth +2*kMessageCell_PadingWidth,
179179
mediaViewHeight +textSize.height + kMessageCell_PadingHeight*(_curPriMsg.content.length > 0? 3:2));
180180
} else if (curPriMsg.file || curPriMsg.voiceMedia) {
@@ -232,7 +232,9 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
232232
_contentLabel.textColor = [UIColor blackColor];
233233
_bgImgView.frame = bgImgViewFrame;
234234
}
235-
if (_voiceView) {
235+
if (_voiceView
236+
|| [_curPriMsg isSingleBigMonkey]
237+
) {
236238
bgImg = nil; //使用bubbleView的背景
237239
_voiceView.type = BubbleTypeRight;
238240
}
@@ -246,7 +248,7 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
246248
[_bgImgView setImage:bgImg];
247249

248250
if (_mediaView) {
249-
CGFloat contentWidth = [_curPriMsg isSingleBigMonkey]? [MessageMediaItemCCell singleCcellSize].width : kMessageCell_ContentWidth;
251+
CGFloat contentWidth = [_curPriMsg isSingleBigMonkey]? [MessageMediaItemCCell monkeyCcellSize].width : kMessageCell_ContentWidth;
250252
[_mediaView setSize:CGSizeMake(contentWidth, mediaViewHeight)];
251253
[_mediaView reloadData];
252254
}
@@ -336,7 +338,7 @@ + (CGFloat)mediaViewHeightWithObj:(PrivateMessage *)curPriMsg{
336338
mediaViewHeight += [MessageMediaItemCCell ccellSizeWithObj:curPriMsg.nextImg].height;
337339
}else{
338340
if ([curPriMsg isSingleBigMonkey]) {
339-
mediaViewHeight += [MessageMediaItemCCell singleCcellSize].height;
341+
mediaViewHeight += [MessageMediaItemCCell monkeyCcellSize].height;
340342
}else{
341343
for (HtmlMediaItem *curItem in curPriMsg.htmlMedia.imageItems) {
342344
mediaViewHeight += [MessageMediaItemCCell ccellSizeWithObj:curItem].height +kMessageCell_PadingHeight;
@@ -377,7 +379,7 @@ - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollection
377379
itemSize = [MessageMediaItemCCell ccellSizeWithObj:_curPriMsg.nextImg];
378380
}else{
379381
if ([_curPriMsg isSingleBigMonkey]) {
380-
itemSize = [MessageMediaItemCCell singleCcellSize];
382+
itemSize = [MessageMediaItemCCell monkeyCcellSize];
381383
}else{
382384
HtmlMediaItem *curItem = [_curPriMsg.htmlMedia.imageItems objectAtIndex:indexPath.row];
383385
itemSize = [MessageMediaItemCCell ccellSizeWithObj:curItem];

0 commit comments

Comments
 (0)