优化首页菜单menu 的UI

This commit is contained in:
bluesea 2024-04-07 10:47:59 +08:00
parent 31cc0aea96
commit 027ca5d44b
5 changed files with 28 additions and 27 deletions

View File

@ -68,7 +68,7 @@ class CCDatePickerView: UIView {
mBackBtn = UIButton.init(type: UIButton.ButtonType.custom) mBackBtn = UIButton.init(type: UIButton.ButtonType.custom)
self.addSubview(mBackBtn!) self.addSubview(mBackBtn!)
mBackBtn?.setTitle("取消", for: UIControl.State.normal) mBackBtn?.setTitle(NSLocalizedString("取消", comment: ""), for: UIControl.State.normal)
mBackBtn?.setTitleColor(TitleColor, for: UIControl.State.normal) mBackBtn?.setTitleColor(TitleColor, for: UIControl.State.normal)
mBackBtn?.tag = 10 mBackBtn?.tag = 10
mBackBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 14) mBackBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 14)

View File

@ -44,7 +44,7 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeV
var mBottomBtn3:UIButton? var mBottomBtn3:UIButton?
var mineView:CCMineView? var mineView:CCMineView?
var mTopView:UIView? // var mTopView:UIView?
var mBackView:UIView? var mBackView:UIView?
var selectedAssets:[Any] = [] var selectedAssets:[Any] = []
@ -377,15 +377,15 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeV
mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.01) mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.01)
self.view.addSubview(mBackView!) self.view.addSubview(mBackView!)
mTopView = UIView(frame: CGRect(x: 0, y: -StatuBar_Height, width: SCREEN_Width, height: StatuBar_Height)) // mTopView = UIView(frame: CGRect(x: 0, y: -StatuBar_Height, width: SCREEN_Width, height: StatuBar_Height))
mTopView?.backgroundColor = UIColor.hexStringToColor(hexString: "#2C2737") // mTopView?.backgroundColor = UIColor.hexStringToColor(hexString: "#2C2737")
self.view.addSubview(mTopView!) // self.view.addSubview(mTopView!)
let tap:UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action: #selector(tapsender(sender:))) let tap:UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action: #selector(tapsender(sender:)))
mBackView!.addGestureRecognizer(tap) mBackView!.addGestureRecognizer(tap)
mineView = CCMineView(frame: CGRect.init(x: SCREEN_Width, y: StatuBar_Height, width: SCREEN_Width-108, height: SCREEN_Height - StatuBar_Height)) mineView = CCMineView(frame: CGRect.init(x: -SCREEN_Width, y: 0, width: SCREEN_Width-108, height: SCREEN_Height))
self.view.addSubview(mineView!) self.view.addSubview(mineView!)
mineView!.handle = {dic in mineView!.handle = {dic in
print(dic["name"] as Any) print(dic["name"] as Any)
@ -426,8 +426,8 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeV
func addAnimation(){ func addAnimation(){
UIView.animate(withDuration: 0.3) { [weak self] in UIView.animate(withDuration: 0.3) { [weak self] in
self!.mTopView?.top = 0 // self!.mTopView?.top = 0
self!.mineView!.right = SCREEN_Width self!.mineView!.left = 0
self!.mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.5) self!.mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.5)
} completion: { re in } completion: { re in
@ -437,13 +437,13 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeV
func deleteMenu(){ func deleteMenu(){
UIView.animate(withDuration: 0.3) { [weak self] in UIView.animate(withDuration: 0.3) { [weak self] in
self!.mTopView?.bottom = 0 // self!.mTopView?.bottom = 0
self!.mineView!.left = SCREEN_Width self!.mineView!.left = -SCREEN_Width
self!.mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.01) self!.mBackView!.backgroundColor = UIColor.colorWithRGB(_r: 0, _g: 0, _b: 0, alpha: 0.01)
} completion: {[weak self] re in } completion: {[weak self] re in
self!.mTopView?.removeFromSuperview() // self!.mTopView?.removeFromSuperview()
self!.mTopView = nil // self!.mTopView = nil
self!.mineView?.removeFromSuperview() self!.mineView?.removeFromSuperview()
self!.mineView = nil self!.mineView = nil
self!.mBackView?.removeFromSuperview() self!.mBackView?.removeFromSuperview()

View File

@ -38,9 +38,10 @@ class CCMineView: UIView,UITableViewDelegate,UITableViewDataSource{
self.layer.addSublayer(layer0) self.layer.addSublayer(layer0)
mImgView = UIImageView() mImgView = UIImageView()
mImgView!.bounds = CGRect(x: 0, y: 0, width: 48, height: 48) mImgView!.bounds = CGRect(x: 0, y: 0, width: 60, height: 60)
mImgView!.top = 26 mImgView!.top = KStatusBarHeight+20
mImgView!.left = 32 // mImgView!.left = 32
mImgView!.centerX = self.width*0.5
self.addSubview(mImgView!) self.addSubview(mImgView!)
mImgView!.backgroundColor = BackGroundColor mImgView!.backgroundColor = BackGroundColor
mImgView!.image = UIImage(named: "logo") mImgView!.image = UIImage(named: "logo")
@ -48,18 +49,18 @@ class CCMineView: UIView,UITableViewDelegate,UITableViewDataSource{
mImgView!.layer.cornerRadius = 4 mImgView!.layer.cornerRadius = 4
mLabel = UILabel() // mLabel = UILabel()
mLabel!.bounds = CGRect(x: 0, y: 0, width: 100, height: 0) // mLabel!.bounds = CGRect(x: 0, y: 0, width: 100, height: 0)
mLabel!.textColor = UIColor.white // mLabel!.textColor = UIColor.white
mLabel!.font = UIFont.systemFont(ofSize: 16) // mLabel!.font = UIFont.systemFont(ofSize: 16)
self.addSubview(mLabel!) // self.addSubview(mLabel!)
mLabel!.text = "VPCamera" // mLabel!.text = "VPCamera"
mLabel!.sizeToFit() // mLabel!.sizeToFit()
mLabel!.centerY = mImgView!.centerY // mLabel!.centerY = mImgView!.centerY
mLabel!.left = mImgView!.right + 15 // mLabel!.left = mImgView!.right + 15
self.mTableView = UITableView.init(frame: CGRect.init(x: 0, y: 100, width: self.width, height: self.height - 100), style: UITableView.Style.grouped) self.mTableView = UITableView.init(frame: CGRect.init(x: 0, y: 152, width: self.width, height: self.height - 100), style: UITableView.Style.grouped)
self.addSubview(self.mTableView!) self.addSubview(self.mTableView!)
self.mTableView!.delegate = (self as UITableViewDelegate) self.mTableView!.delegate = (self as UITableViewDelegate)
self.mTableView!.dataSource = (self as UITableViewDataSource) self.mTableView!.dataSource = (self as UITableViewDataSource)
@ -160,7 +161,7 @@ class CCMineCell: UITableViewCell {
mLine = UIView() mLine = UIView()
mLine!.frame = CGRect(x: 16, y: CCMineCellH - 0.5, width: CCMineCellW - 32, height: 0.5) mLine!.frame = CGRect(x: 16, y: CCMineCellH - 0.5, width: CCMineCellW - 32, height: 0.5)
mLine!.backgroundColor = UIColor.colorWithRGB(_r: 255, _g: 255, _b: 255, alpha: 0.5) mLine!.backgroundColor = UIColor.colorWithRGB(_r: 255, _g: 255, _b: 255, alpha: 0.2)
self.contentView.addSubview(mLine!) self.contentView.addSubview(mLine!)
} }

View File

@ -201,7 +201,7 @@ class CCBottomMenuPopView: UIView,UITableViewDelegate, UITableViewDataSource {
}else if indexPath.section == 1 }else if indexPath.section == 1
{ {
cell?.titleLabel.text = "取消" cell?.titleLabel.text = NSLocalizedString("取消", comment: "")
cell?.iconImageView.isHidden = true cell?.iconImageView.isHidden = true
cell?.iconImageView.image = nil cell?.iconImageView.image = nil
cell?.iconImageView.snp.updateConstraints { make in cell?.iconImageView.snp.updateConstraints { make in