Skip to content

Commit d076a29

Browse files
committed
发送图片时,Cell的大小不正确
1 parent e87c5a0 commit d076a29

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Coding_iOS/Models/PrivateMessage.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ - (instancetype)init
2222
- (void)setContent:(NSString *)content{
2323
if (_content != content) {
2424
_htmlMedia = [HtmlMedia htmlMediaWithString:content showType:MediaShowTypeCode];
25-
if (_htmlMedia.contentDisplay.length <= 0 && _htmlMedia.imageItems.count <= 0) {
25+
if (_htmlMedia.contentDisplay.length <= 0 && _htmlMedia.imageItems.count <= 0 && !_nextImg) {
2626
_content = @" ";//占位
2727
}else{
2828
_content = _htmlMedia.contentDisplay;
@@ -35,12 +35,6 @@ - (BOOL)hasMedia{
3535

3636
+ (instancetype)privateMessageWithObj:(id)obj andFriend:(User *)curFriend{
3737
PrivateMessage *nextMsg = [[PrivateMessage alloc] init];
38-
nextMsg.sender = [Login curLoginUser];
39-
nextMsg.friend = curFriend;
40-
nextMsg.sendStatus = PrivateMessageStatusSending;
41-
nextMsg.created_at = [NSDate date];
42-
nextMsg.content = @"";
43-
nextMsg.extra = @"";
4438
if ([obj isKindOfClass:[NSString class]]) {
4539
nextMsg.content = obj;
4640
}else if ([obj isKindOfClass:[UIImage class]]){
@@ -65,6 +59,12 @@ + (instancetype)privateMessageWithObj:(id)obj andFriend:(User *)curFriend{
6559
nextMsg.content = content;
6660
nextMsg.extra = extra;
6761
}
62+
nextMsg.sender = [Login curLoginUser];
63+
nextMsg.friend = curFriend;
64+
nextMsg.sendStatus = PrivateMessageStatusSending;
65+
nextMsg.created_at = [NSDate date];
66+
nextMsg.content = @"";
67+
nextMsg.extra = @"";
6868
return nextMsg;
6969
};
7070

0 commit comments

Comments
 (0)