Browse Source

修复微聊发送英文cell高度不对问题

master
公司电脑 1 year ago
parent
commit
a541d8cf01
  1. BIN
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  2. 102
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 5
      tongxin/AppDelegate.m
  4. 5
      tongxin/PrefixHeader.pch
  5. 7
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m
  6. 16
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m
  7. 1
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m
  8. 2
      tongxin/VC/HomeMeg/View/HomeMsgTableViewCell.m

BIN
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

102
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -350,8 +350,8 @@ @@ -350,8 +350,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "525"
endingLineNumber = "525"
startingLineNumber = "530"
endingLineNumber = "530"
landmarkName = "AppDelegate"
landmarkType = "3">
</BreakpointContent>
@ -366,8 +366,8 @@ @@ -366,8 +366,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "804"
endingLineNumber = "804"
startingLineNumber = "809"
endingLineNumber = "809"
landmarkName = "-applicationWillEnterForeground:"
landmarkType = "7">
</BreakpointContent>
@ -382,8 +382,8 @@ @@ -382,8 +382,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "269"
endingLineNumber = "269"
startingLineNumber = "274"
endingLineNumber = "274"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -398,8 +398,8 @@ @@ -398,8 +398,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "247"
endingLineNumber = "247"
startingLineNumber = "252"
endingLineNumber = "252"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -446,8 +446,8 @@ @@ -446,8 +446,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "641"
endingLineNumber = "641"
startingLineNumber = "646"
endingLineNumber = "646"
landmarkName = "-handlePushMsg:"
landmarkType = "7">
</BreakpointContent>
@ -926,8 +926,8 @@ @@ -926,8 +926,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "313"
endingLineNumber = "313"
startingLineNumber = "327"
endingLineNumber = "327"
landmarkName = "-configureBubbleImageView:"
landmarkType = "7">
</BreakpointContent>
@ -1112,14 +1112,14 @@ @@ -1112,14 +1112,14 @@
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "13AFE679-2D3C-4680-B009-87CE9DC9BCB3"
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1351"
endingLineNumber = "1351"
startingLineNumber = "1357"
endingLineNumber = "1357"
landmarkName = "-tableView:heightForRowAtIndexPath:"
landmarkType = "7">
</BreakpointContent>
@ -1134,8 +1134,8 @@ @@ -1134,8 +1134,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "540"
endingLineNumber = "540"
startingLineNumber = "554"
endingLineNumber = "554"
landmarkName = "-layoutSubviews"
landmarkType = "7">
</BreakpointContent>
@ -1154,6 +1154,38 @@ @@ -1154,6 +1154,38 @@
endingLineNumber = "438"
landmarkName = "+calculateCellHeightWithMessage:displaysTimestamp:"
landmarkType = "7">
<Locations>
<Location
uuid = "69F86FF0-5B22-4222-AB23-27FA7355D62D - 807f8fa2c48f6fb4"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "+[XHMessageTableViewCell calculateCellHeightWithMessage:displaysTimestamp:]"
moduleName = "&#x4f5c;&#x4e1a;&#x5e2e;&#x624b;&#x8868;"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/zuoyebang/tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "439"
endingLineNumber = "439"
offsetFromSymbolStart = "300">
</Location>
<Location
uuid = "69F86FF0-5B22-4222-AB23-27FA7355D62D - 807f8fa2c48f6fb4"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "+[XHMessageTableViewCell calculateCellHeightWithMessage:displaysTimestamp:]"
moduleName = "&#x4f5c;&#x4e1a;&#x5e2e;&#x624b;&#x8868;"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/zuoyebang/tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "439"
endingLineNumber = "439"
offsetFromSymbolStart = "372">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -1166,8 +1198,8 @@ @@ -1166,8 +1198,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "584"
endingLineNumber = "584"
startingLineNumber = "585"
endingLineNumber = "585"
landmarkName = "-layoutSubviews"
landmarkType = "7">
</BreakpointContent>
@ -1182,8 +1214,8 @@ @@ -1182,8 +1214,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "561"
endingLineNumber = "561"
startingLineNumber = "562"
endingLineNumber = "562"
landmarkName = "-layoutSubviews"
landmarkType = "7">
</BreakpointContent>
@ -1223,16 +1255,32 @@ @@ -1223,16 +1255,32 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A04503D2-C065-41C5-BEEB-DF3BEFD4515B"
shouldBeEnabled = "Yes"
uuid = "5F454C3D-8FD0-487E-AB5D-543DD557C1C7"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/VC/Map/MapViewController.m"
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "942"
endingLineNumber = "942"
landmarkName = "-subMsgView"
startingLineNumber = "898"
endingLineNumber = "898"
landmarkName = "-calculateCellHeightWithMessage:atIndexPath:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4F734BC7-AB7B-43AC-8042-8BE80B3CE0AB"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "432"
endingLineNumber = "432"
landmarkName = "+calculateCellHeightWithMessage:displaysTimestamp:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>

5
tongxin/AppDelegate.m

@ -41,6 +41,8 @@ @@ -41,6 +41,8 @@
#import "GCDTimerManager.h"
#define kMusicTime 20
#define videoTimerCount 3
@ -86,6 +88,9 @@ @@ -86,6 +88,9 @@
//}
//高德 poi 搜索
[AMapServices sharedServices].apiKey = AMapKey;
// [MAMapView updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain];
// [MAMapView updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
// [AMapSearchAPI updatePrivacyShow:(AMapPrivacyShowStatusDidShow) privacyInfo:(AMapPrivacyInfoStatusDidContain)];
[self initIQKeyBorard];//键盘自动调整

5
tongxin/PrefixHeader.pch

@ -35,6 +35,9 @@ @@ -35,6 +35,9 @@
#import "MyUILabel.h"
#import "UIView+Effects.h"
#import <EasyShowView/EasyShowView.h>
//#import <MAMapKit/MAMapKit.h>
//#import <AMapLocationKit/AMapLocationKit.h>
//#import <AMapSearchKit/AMapSearchKit.h>
//#import <Hyphenate/Hyphenate.h>
///** @brief 实时音视频呼叫 */
@ -53,7 +56,7 @@ @@ -53,7 +56,7 @@
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f)
#define IS_IPHONE_X (IS_IOS_11 && IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 812))
#define IS_IPHONE_X (IS_IOS_11 && IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 812) && [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0)
#define iPhoneX (IS_IPHONE_X ? YES : NO)

7
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m

@ -1347,10 +1347,13 @@ static CGPoint delayOffset = {0.0}; @@ -1347,10 +1347,13 @@ static CGPoint delayOffset = {0.0};
CGFloat calculateCellHeight = 0;
if ([self.delegate respondsToSelector:@selector(tableView:heightForRowAtIndexPath:targetMessage:)]) {
if ([self.delegate respondsToSelector:@selector(tableView:heightForRowAtIndexPath:targetMessage:)])
{
calculateCellHeight = [self.delegate tableView:tableView heightForRowAtIndexPath:indexPath targetMessage:message];
return calculateCellHeight;
} else {
}
else
{
calculateCellHeight = [self calculateCellHeightWithMessage:message atIndexPath:indexPath];
}

16
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m

@ -118,6 +118,19 @@ @@ -118,6 +118,19 @@
+ (CGSize)neededSizeForLocalPostion {
return CGSizeMake(140, 140);
}
// 判断问文字消息内容是否是中文
+ (BOOL)IsChinese:(NSString *)str
{
for(int i=0; i< [str length];i++)
{
int a = [str characterAtIndex:i];
if( a > 0x4e00 && a < 0x9fff)
{
return YES;
}
}
return NO;
}
// 计算Cell需要实际Message内容的大小
+ (CGFloat)calculateCellHeightWithMessage:(XHMessage *)message {
@ -130,8 +143,9 @@ @@ -130,8 +143,9 @@
CGSize bubbleSize;
switch (message.messageMediaType) {
case XHBubbleMessageMediaTypeText: {
CGFloat ise = [self IsChinese:message.content] ? 2 : 5;
CGSize needTextSize = [XHMessageBubbleView neededSizeForText:message.content];
bubbleSize = CGSizeMake(needTextSize.width + kXHLeftTextHorizontalBubblePadding + kXHRightTextHorizontalBubblePadding , needTextSize.height + kXHHaveBubbleMargin * 2 + kXHTopAndBottomBubbleMargin * 2); //这里*4的原因是:气泡内部的文本也做了margin,而且margin的大小和气泡的margin一样大小,所以需要加上*2的间隙大小
bubbleSize = CGSizeMake(needTextSize.width + kXHLeftTextHorizontalBubblePadding + kXHRightTextHorizontalBubblePadding , needTextSize.height + kXHHaveBubbleMargin * 2 + kXHTopAndBottomBubbleMargin * 2 + ise); //这里*4的原因是:气泡内部的文本也做了margin,而且margin的大小和气泡的margin一样大小,所以需要加上*2的间隙大小
break;
}
case XHBubbleMessageMediaTypeVoice: {

1
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m

@ -439,6 +439,7 @@ static const CGFloat kXHUserNameLabelHeight = 12; @@ -439,6 +439,7 @@ static const CGFloat kXHUserNameLabelHeight = 12;
return MAX(bubbleMessageHeight, userInfoNeedHeight)+userHi;
}
#pragma mark - Life cycle
- (void)setup {

2
tongxin/VC/HomeMeg/View/HomeMsgTableViewCell.m

@ -122,7 +122,7 @@ @@ -122,7 +122,7 @@
make.bottom.equalTo(iconImg.mas_centerY).inset(3);
}];
UILabel *msgLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:Font_(13) textColor:KKGrey163 text:@"" Radius:0];
UILabel *msgLabel = [UICommon ui_label:CGRectZero lines:2 align:NSTextAlignmentLeft font:Font_(13) textColor:KKGrey163 text:@"" Radius:0];
self.msgLabel = msgLabel;
[self.contentView addSubview:msgLabel];
[msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {

Loading…
Cancel
Save