Commit e747a779 authored by Steven杜宇's avatar Steven杜宇

// AI

parent 4cbb34a3
...@@ -366,6 +366,18 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource ...@@ -366,6 +366,18 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
return height return height
} }
if msgType == .recommendText { // 推荐文字消息
let label = UILabel()
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:12)
label.numberOfLines = 0
label.text = message.body.contentText
let maxWidth = KScreenWidth-20*2-16*2 // 最大宽度限制
let size = label.sizeThatFits(CGSize(width: maxWidth, height: .greatestFiniteMagnitude))
var textHeight = ceil(size.height)
return textHeight+10.0*3.0
}
if msgType != .text { if msgType != .text {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
......
...@@ -508,6 +508,18 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -508,6 +508,18 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
return height return height
} }
if msgType == .recommendText { // 推荐文字消息
let label = UILabel()
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:12)
label.numberOfLines = 0
label.text = message.body.contentText
let maxWidth = KScreenWidth-20*2-16*2 // 最大宽度限制
let size = label.sizeThatFits(CGSize(width: maxWidth, height: .greatestFiniteMagnitude))
var textHeight = ceil(size.height)
return textHeight+10.0*3.0
}
if msgType != .text { if msgType != .text {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment