Commit 019ff640 authored by lujunye's avatar lujunye

优化按钮点击范围

parent 4052be48
...@@ -1125,31 +1125,58 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1125,31 +1125,58 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
changeCellSortView?.frame = CGRect(x: 0, y: fullScreenHeight - CGFloat(h), width: fullScreenWidth, height: CGFloat(h)) changeCellSortView?.frame = CGRect(x: 0, y: fullScreenHeight - CGFloat(h), width: fullScreenWidth, height: CGFloat(h))
var btnH = 49
if IS_IPHONE_X {
btnH = 83
}
let leftBtn = UIButton() let leftBtn = UIButton()
leftBtn.addTarget(self, action: #selector(changeCellSortAc(sender:)), for: .touchUpInside) leftBtn.addTarget(self, action: #selector(changeCellSortAc(sender:)), for: .touchUpInside)
leftBtn.backgroundColor = RGB(r: 170, g: 205, b: 240) leftBtn.backgroundColor = RGB(r: 170, g: 205, b: 240)
leftBtn.setTitle("取消", for: .normal) // leftBtn.setTitle("取消", for: .normal)
leftBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 17) // leftBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 17)
changeCellSortView?.addSubview(leftBtn) changeCellSortView?.addSubview(leftBtn)
leftBtn.snp.makeConstraints { (make) in leftBtn.snp.makeConstraints { (make) in
make.left.bottom.equalTo(0) make.left.bottom.equalTo(0)
make.height.equalTo(49) make.height.equalTo(btnH)
make.width.equalTo(fullScreenWidth*0.5) make.width.equalTo(fullScreenWidth*0.5)
} }
let leftT = UILabel()
leftT.text = "取消"
leftT.font = UIFont(name: "PingFangSC-Medium", size: 17)
leftT.textColor = .white
leftT.textAlignment = .center
leftBtn.addSubview(leftT)
leftT.snp.makeConstraints { (make) in
make.left.top.right.equalTo(0)
make.height.equalTo(49)
}
let rightBtn = UIButton() let rightBtn = UIButton()
rightBtn.addTarget(self, action: #selector(changeCellSortAc(sender:)), for: .touchUpInside) rightBtn.addTarget(self, action: #selector(changeCellSortAc(sender:)), for: .touchUpInside)
rightBtn.tag = 1 rightBtn.tag = 1
rightBtn.backgroundColor = RGB(r: 53, g: 135, b: 219) rightBtn.backgroundColor = RGB(r: 53, g: 135, b: 219)
rightBtn.setTitle("确定", for: .normal) // rightBtn.setTitle("确定", for: .normal)
rightBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 17) // rightBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 17)
changeCellSortView?.addSubview(rightBtn) changeCellSortView?.addSubview(rightBtn)
rightBtn.snp.makeConstraints { (make) in rightBtn.snp.makeConstraints { (make) in
make.left.equalTo(leftBtn.snp.right) make.left.equalTo(leftBtn.snp.right)
make.bottom.equalTo(0) make.bottom.equalTo(0)
make.height.equalTo(49) make.height.equalTo(btnH)
make.width.equalTo(fullScreenWidth*0.5) make.width.equalTo(fullScreenWidth*0.5)
} }
let rightT = UILabel()
rightT.text = "确定"
rightT.font = UIFont(name: "PingFangSC-Medium", size: 17)
rightT.textColor = .white
rightT.textAlignment = .center
rightBtn.addSubview(rightT)
rightT.snp.makeConstraints { (make) in
make.left.top.right.equalTo(0)
make.height.equalTo(49)
}
let titleLbl = UILabel() let titleLbl = UILabel()
titleLbl.textAlignment = .center titleLbl.textAlignment = .center
......
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