Skip to content

Commit 6f7774b

Browse files
committed
gif照片引起崩溃的隐患
1 parent 6239b85 commit 6f7774b

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

Coding_iOS/Views/CCell/MessageMediaItemCCell.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
#import <UIKit/UIKit.h>
1010
#import "HtmlMedia.h"
1111
#import "PrivateMessage.h"
12+
#import "YLImageView.h"
1213

1314
@interface MessageMediaItemCCell : UICollectionViewCell
1415
@property (copy, nonatomic) void (^refreshMessageMediaCCellBlock)(CGFloat diff);
1516

1617
@property (strong, nonatomic) PrivateMessage *curPriMsg, *prePriMsg;
1718
@property (strong, nonatomic) NSObject *curObj;
18-
@property (strong, nonatomic) UIImageView *imgView;
19+
@property (strong, nonatomic) YLImageView *imgView;
1920

2021
+(CGSize)ccellSizeWithObj:(NSObject *)obj;
2122
@end

Coding_iOS/Views/CCell/MessageMediaItemCCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ - (void)setCurObj:(NSObject *)curObj{
2727
return;
2828
}
2929
if (!_imgView) {
30-
_imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kMessageCell_ContentWidth, kMessageCell_ContentWidth)];
30+
_imgView = [[YLImageView alloc] initWithFrame:CGRectMake(0, 0, kMessageCell_ContentWidth, kMessageCell_ContentWidth)];
3131
_imgView.contentMode = UIViewContentModeScaleAspectFill;
3232
_imgView.clipsToBounds = YES;
3333
_imgView.layer.masksToBounds = YES;

Coding_iOS/Views/CCell/TweetMediaItemCCell.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
#import <UIKit/UIKit.h>
1010
#import "HtmlMedia.h"
11+
#import "YLImageView.h"
1112

1213
@interface TweetMediaItemCCell : UICollectionViewCell
1314
@property (strong, nonatomic) HtmlMediaItem *curMediaItem;
14-
@property (strong, nonatomic) UIImageView *imgView;
15+
@property (strong, nonatomic) YLImageView *imgView;
1516

1617
+(CGSize)ccellSizeWithObj:(id)obj;
1718
@end

Coding_iOS/Views/CCell/TweetMediaItemCCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ - (id)initWithFrame:(CGRect)frame
2727

2828
- (void)setCurMediaItem:(HtmlMediaItem *)curMediaItem{
2929
if (!_imgView) {
30-
_imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kTweetMediaItemCCell_Width, kTweetMediaItemCCell_Width)];
30+
_imgView = [[YLImageView alloc] initWithFrame:CGRectMake(0, 0, kTweetMediaItemCCell_Width, kTweetMediaItemCCell_Width)];
3131
_imgView.contentMode = UIViewContentModeScaleAspectFill;
3232
_imgView.clipsToBounds = YES;
3333
_imgView.layer.masksToBounds = YES;

Coding_iOS/Views/CCell/TweetMediaItemSingleCCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ - (id)initWithFrame:(CGRect)frame
2929

3030
- (void)setCurMediaItem:(HtmlMediaItem *)curMediaItem{
3131
if (!_imgView) {
32-
_imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 2, kTweetMediaItemCCellSingle_Width, kTweetMediaItemCCellSingle_Width)];
32+
_imgView = [[YLImageView alloc] initWithFrame:CGRectMake(0, 2, kTweetMediaItemCCellSingle_Width, kTweetMediaItemCCellSingle_Width)];
3333
_imgView.contentMode = UIViewContentModeScaleAspectFill;
3434
_imgView.clipsToBounds = YES;
3535
_imgView.layer.masksToBounds = YES;

0 commit comments

Comments
 (0)