PublishNewAlbumNavigationBarView.swift 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // PublishNewAlbumNavigationBarView.swift
  3. // RainbowPlanet
  4. //
  5. // Created by 南鑫林 on 2019/11/18.
  6. // Copyright © 2019 RainbowPlanet. All rights reserved.
  7. //
  8. import UIKit
  9. class PublishNewAlbumNavigationBarView: BaseView {
  10. override func setupViews() {
  11. backgroundColor = .white
  12. addSubview(navigationBgView)
  13. navigationBgView.addSubview(backButton)
  14. navigationBgView.addSubview(titleButton)
  15. navigationBgView.addSubview(finishButton)
  16. }
  17. override func setupLayouts() {
  18. navigationBgView.snp.makeConstraints { (make) in
  19. make.top.equalTo(kSafeStatusBarHeight)
  20. make.left.right.bottom.equalToSuperview()
  21. }
  22. backButton.snp.makeConstraints { (make) in
  23. make.centerY.equalToSuperview()
  24. make.left.equalTo(14)
  25. make.size.equalTo(30)
  26. }
  27. titleButton.snp.makeConstraints { (make) in
  28. make.center.equalToSuperview()
  29. }
  30. titleButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 2)
  31. finishButton.snp.makeConstraints { (make) in
  32. make.centerY.equalToSuperview()
  33. make.right.equalTo(-14)
  34. }
  35. }
  36. lazy var navigationBgView: UIView = {
  37. let navigationBgView = UIView()
  38. return navigationBgView
  39. }()
  40. /// 返回按钮
  41. lazy var backButton: UIButton = {
  42. let backButton = UIButton(type: UIButton.ButtonType.custom)
  43. backButton.setImage(kImage(name: "navbar_back_black"), for: UIControl.State.normal)
  44. return backButton
  45. }()
  46. /// 标题按钮
  47. lazy var titleButton: UIButton = {
  48. let backButton = UIButton(type: UIButton.ButtonType.custom)
  49. backButton.setImage(kImage(name: "ico_arrow_down"), for: UIControl.State.normal)
  50. backButton.setImage(kImage(name: "ico_arrow_up"), for: UIControl.State.selected)
  51. backButton.setTitle("所有照片", for: UIControl.State.normal)
  52. backButton.titleLabel?.font = kMediumFont16
  53. backButton.setTitleColor(k333333Color, for: UIControl.State.normal)
  54. return backButton
  55. }()
  56. /// 完成
  57. lazy var finishButton: UIButton = {
  58. let finishButton = UIButton(type: UIButton.ButtonType.custom)
  59. finishButton.isEnabled = false
  60. finishButton.setTitle("完成", for: UIControl.State.disabled)
  61. finishButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
  62. finishButton.setTitleColor(k999999Color, for: UIControl.State.normal)
  63. backButton.titleLabel?.font = kRegularFont14
  64. return finishButton
  65. }()
  66. }