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 @@
filePath = "tongxin/AppDelegate.m" filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "525" startingLineNumber = "530"
endingLineNumber = "525" endingLineNumber = "530"
landmarkName = "AppDelegate" landmarkName = "AppDelegate"
landmarkType = "3"> landmarkType = "3">
</BreakpointContent> </BreakpointContent>
@ -366,8 +366,8 @@
filePath = "tongxin/AppDelegate.m" filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "804" startingLineNumber = "809"
endingLineNumber = "804" endingLineNumber = "809"
landmarkName = "-applicationWillEnterForeground:" landmarkName = "-applicationWillEnterForeground:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -382,8 +382,8 @@
filePath = "tongxin/AppDelegate.m" filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "269" startingLineNumber = "274"
endingLineNumber = "269" endingLineNumber = "274"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:" landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -398,8 +398,8 @@
filePath = "tongxin/AppDelegate.m" filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "247" startingLineNumber = "252"
endingLineNumber = "247" endingLineNumber = "252"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:" landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -446,8 +446,8 @@
filePath = "tongxin/AppDelegate.m" filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "641" startingLineNumber = "646"
endingLineNumber = "641" endingLineNumber = "646"
landmarkName = "-handlePushMsg:" landmarkName = "-handlePushMsg:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -926,8 +926,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "313" startingLineNumber = "327"
endingLineNumber = "313" endingLineNumber = "327"
landmarkName = "-configureBubbleImageView:" landmarkName = "-configureBubbleImageView:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -1112,14 +1112,14 @@
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "13AFE679-2D3C-4680-B009-87CE9DC9BCB3" uuid = "13AFE679-2D3C-4680-B009-87CE9DC9BCB3"
shouldBeEnabled = "Yes" shouldBeEnabled = "No"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "1351" startingLineNumber = "1357"
endingLineNumber = "1351" endingLineNumber = "1357"
landmarkName = "-tableView:heightForRowAtIndexPath:" landmarkName = "-tableView:heightForRowAtIndexPath:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -1134,8 +1134,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageBubbleView.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "540" startingLineNumber = "554"
endingLineNumber = "540" endingLineNumber = "554"
landmarkName = "-layoutSubviews" landmarkName = "-layoutSubviews"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -1154,6 +1154,38 @@
endingLineNumber = "438" endingLineNumber = "438"
landmarkName = "+calculateCellHeightWithMessage:displaysTimestamp:" landmarkName = "+calculateCellHeightWithMessage:displaysTimestamp:"
landmarkType = "7"> 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> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy <BreakpointProxy
@ -1166,8 +1198,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "584" startingLineNumber = "585"
endingLineNumber = "584" endingLineNumber = "585"
landmarkName = "-layoutSubviews" landmarkName = "-layoutSubviews"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -1182,8 +1214,8 @@
filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "561" startingLineNumber = "562"
endingLineNumber = "561" endingLineNumber = "562"
landmarkName = "-layoutSubviews" landmarkName = "-layoutSubviews"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
@ -1223,16 +1255,32 @@
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "A04503D2-C065-41C5-BEEB-DF3BEFD4515B" uuid = "5F454C3D-8FD0-487E-AB5D-543DD557C1C7"
shouldBeEnabled = "Yes" shouldBeEnabled = "No"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "tongxin/VC/Map/MapViewController.m" filePath = "tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "942" startingLineNumber = "898"
endingLineNumber = "942" endingLineNumber = "898"
landmarkName = "-subMsgView" 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"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>

5
tongxin/AppDelegate.m

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

5
tongxin/PrefixHeader.pch

@ -35,6 +35,9 @@
#import "MyUILabel.h" #import "MyUILabel.h"
#import "UIView+Effects.h" #import "UIView+Effects.h"
#import <EasyShowView/EasyShowView.h> #import <EasyShowView/EasyShowView.h>
//#import <MAMapKit/MAMapKit.h>
//#import <AMapLocationKit/AMapLocationKit.h>
//#import <AMapSearchKit/AMapSearchKit.h>
//#import <Hyphenate/Hyphenate.h> //#import <Hyphenate/Hyphenate.h>
///** @brief 实时音视频呼叫 */ ///** @brief 实时音视频呼叫 */
@ -53,7 +56,7 @@
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f) #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) #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};
CGFloat calculateCellHeight = 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]; calculateCellHeight = [self.delegate tableView:tableView heightForRowAtIndexPath:indexPath targetMessage:message];
return calculateCellHeight; return calculateCellHeight;
} else { }
else
{
calculateCellHeight = [self calculateCellHeightWithMessage:message atIndexPath:indexPath]; calculateCellHeight = [self calculateCellHeightWithMessage:message atIndexPath:indexPath];
} }

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

@ -118,6 +118,19 @@
+ (CGSize)neededSizeForLocalPostion { + (CGSize)neededSizeForLocalPostion {
return CGSizeMake(140, 140); 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内容的大小 // 计算Cell需要实际Message内容的大小
+ (CGFloat)calculateCellHeightWithMessage:(XHMessage *)message { + (CGFloat)calculateCellHeightWithMessage:(XHMessage *)message {
@ -130,8 +143,9 @@
CGSize bubbleSize; CGSize bubbleSize;
switch (message.messageMediaType) { switch (message.messageMediaType) {
case XHBubbleMessageMediaTypeText: { case XHBubbleMessageMediaTypeText: {
CGFloat ise = [self IsChinese:message.content] ? 2 : 5;
CGSize needTextSize = [XHMessageBubbleView neededSizeForText:message.content]; 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; break;
} }
case XHBubbleMessageMediaTypeVoice: { case XHBubbleMessageMediaTypeVoice: {

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

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

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

@ -122,7 +122,7 @@
make.bottom.equalTo(iconImg.mas_centerY).inset(3); 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.msgLabel = msgLabel;
[self.contentView addSubview:msgLabel]; [self.contentView addSubview:msgLabel];
[msgLabel mas_makeConstraints:^(MASConstraintMaker *make) { [msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {

Loading…
Cancel
Save