Commit 6ff42b8a authored by Steven杜宇's avatar Steven杜宇

// AI

parent 242e1916
......@@ -383,6 +383,8 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
return UITableView.automaticDimension
}
// 以下是文字消息计算高度
let label = UILabel()
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
......@@ -398,7 +400,7 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
)
label.attributedText = attributedText
let maxWidth = KScreenWidth-20*2-16*2 // 最大宽度限制
let maxWidth = message.isSelf ? KScreenWidth-58-20-16*2 : KScreenWidth-20*2-16*2 // 最大宽度限制
let size = label.sizeThatFits(CGSize(width: maxWidth, height: .greatestFiniteMagnitude))
var textHeight = ceil(size.height)
if textHeight < 20.0 {
......
......@@ -517,6 +517,8 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
return UITableView.automaticDimension
}
// 以下是文字消息计算高度
let label = UILabel()
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:14)
......@@ -532,7 +534,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
)
label.attributedText = attributedText
let maxWidth = KScreenWidth-20*2-16*2 // 最大宽度限制
let maxWidth = message.isSelf ? KScreenWidth-58-20-16*2 : KScreenWidth-20*2-16*2 // 最大宽度限制
let size = label.sizeThatFits(CGSize(width: maxWidth, height: .greatestFiniteMagnitude))
var textHeight = ceil(size.height)
if textHeight < 20.0 {
......
......@@ -35,7 +35,7 @@ class YHAITextMessageCell: UITableViewCell {
if message.isSelf {
whiteContentView.backgroundColor = .brandMainColor
whiteContentView.snp.remakeConstraints { make in
make.left.greaterThanOrEqualTo(20)
make.left.greaterThanOrEqualTo(58)
make.right.equalTo(-20)
make.top.equalTo(16)
make.bottom.equalTo(0)
......@@ -55,11 +55,7 @@ class YHAITextMessageCell: UITableViewCell {
whiteContentView.backgroundColor = .white
whiteContentView.snp.remakeConstraints { make in
make.left.equalTo(20)
if message.getType() == .recommendText {
make.right.lessThanOrEqualTo(-20)
} else {
make.right.equalTo(-20)
}
make.right.equalTo(-20)
make.top.equalTo(16)
make.bottom.equalTo(0)
}
......@@ -170,7 +166,7 @@ class YHAITextMessageCell: UITableViewCell {
make.height.equalTo(37)
make.width.equalTo(82)
}
copyBtn.iconInLeft(spacing: 0.0)
copyBtn.iconInLeft(spacing: 2.0)
return v
......
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