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

// 消息

parent 93c7ec4d
...@@ -14,7 +14,7 @@ class YHMsgViewController: YHBaseViewController { ...@@ -14,7 +14,7 @@ class YHMsgViewController: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped) let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 1.0 tableView.sectionHeaderHeight = 42.0
tableView.estimatedSectionFooterHeight = 1.0 tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -65,10 +65,17 @@ class YHMsgViewController: YHBaseViewController { ...@@ -65,10 +65,17 @@ class YHMsgViewController: YHBaseViewController {
make.bottom.equalToSuperview().offset(-k_Height_TabBar) make.bottom.equalToSuperview().offset(-k_Height_TabBar)
} }
} }
}
extension YHMsgViewController {
@objc func clean() { @objc func clean() {
} }
@objc func didEnableNotifyBtnClicked() {
}
} }
extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource { extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
...@@ -92,7 +99,7 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -92,7 +99,7 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0 return 42.0
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
...@@ -106,7 +113,35 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -106,7 +113,35 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0x3570DC, alpha: 0.06)
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26)
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
label.text = "开启通知,及时掌握最新消息".local
view.addSubview(label)
let enableBtn = UIButton()
enableBtn.setTitle("开启".local, for: .normal)
enableBtn.setTitleColor(UIColor(hex: 0x3570DC), for: .normal)
enableBtn.titleLabel?.font = .PFSC_R(ofSize: 13)
enableBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 12, left: 20, bottom: 12, right: 20)
enableBtn.addTarget(self, action: #selector(didEnableNotifyBtnClicked), for: .touchUpInside)
view.addSubview(enableBtn)
label.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalTo(enableBtn.snp.left).offset(-20)
make.centerY.equalToSuperview()
}
enableBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 26, height: 18))
make.right.equalToSuperview().offset(-20)
make.centerY.equalToSuperview()
}
return view
} }
} }
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