私聊界面的UI完善

This commit is contained in:
fengshuo
2024-03-01 01:27:25 +08:00
parent 26d586290c
commit 678297f771
35 changed files with 4891 additions and 3651 deletions

View File

@@ -7,14 +7,14 @@
import UIKit
import NIMSDK
class ChatVC: BaseViewController {
class ChatVC: BaseViewController, HiddenNavigationBarProtocol {
// /
private var isBecome: Bool = false
///
private var isSended: Bool = true
///
private let ToolBarLastH: CGFloat = 52
private let ToolBarLastH: CGFloat = (52 + SafeAraeBottomHeight)
public init(session: NIMSession) {
vm = ChatViewModel(session: session)
@@ -29,13 +29,19 @@ class ChatVC: BaseViewController {
var vm:ChatViewModel
override var preferredStatusBarStyle: UIStatusBarStyle {
.darkContent
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = ThemeColor(hexStr: "#F6F6F6")
let height = ScreenHeight - (ToolBarLastH + SafeAraeBottomHeight + NavHeight)
chatTableView.frame = CGRect(x: 0, y: 0, width: ScreenWidth, height: height)
let height = ScreenHeight - (ToolBarLastH + NavHeight)
chatTableView.frame = CGRect(x: 0, y: NavHeight, width: ScreenWidth, height: height)
navView.frame = CGRect(x: 0, y: 0, width: ScreenWidth, height: NavHeight)
view.addSubview(chatTableView)
view.addSubview(keyboardView)
view.addSubview(navView)
}
///cell
@@ -43,13 +49,15 @@ class ChatVC: BaseViewController {
chatTableView.register(cellType: ChatTextCell.self)
}
private lazy var chatTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
tableView.delegate = self
tableView.dataSource = self
tableView.tableFooterView = UIView()
tableView.separatorStyle = .none
tableView.backgroundColor = .clear
tableView.backgroundColor = ThemeColor(hexStr: "#F8F8FB")
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
@@ -57,12 +65,20 @@ class ChatVC: BaseViewController {
}()
private lazy var keyboardView: ChatKeyboardView = {
let toolBarY = ScreenHeight - NavHeight - ToolBarLastH - SafeAraeBottomHeight
let toolBarY = ScreenHeight - ToolBarLastH
let view = ChatKeyboardView(frame: CGRect(x: 0, y: toolBarY, width: ScreenWidth, height: ToolBarLastH))
view.backgroundColor = .white
view.delegate = self
return view
}()
private lazy var navView: ChatNavView = {
let view = ChatNavView(frame: .zero)
view.backgroundColor = .white
return view
}()
}
// MARK: - ChatKeyboardViewDelegate