Commit 9ed7e618 authored by David黄金龙's avatar David黄金龙

1、是否 按钮的背景色 字体大小

2、背景色
parent ea627324
...@@ -36,7 +36,7 @@ class YHSelectCountryViewController: YHBaseViewController { ...@@ -36,7 +36,7 @@ class YHSelectCountryViewController: YHBaseViewController {
searchView = { searchView = {
let searchBar = UITextField() let searchBar = UITextField()
searchBar.placeholder = "搜索国家/地区" searchBar.placeholder = "搜索国家/地区"
searchBar.backgroundColor = UIColor(hex: 0xf8f9fb) searchBar.backgroundColor = UIColor.contentBkgColor
searchBar.keyboardType = .default searchBar.keyboardType = .default
searchBar.delegate = self searchBar.delegate = self
searchBar.layer.cornerRadius = 21 searchBar.layer.cornerRadius = 21
...@@ -201,7 +201,7 @@ class YHCountryCollectionViewCell: UICollectionViewCell { ...@@ -201,7 +201,7 @@ class YHCountryCollectionViewCell: UICollectionViewCell {
view.textAlignment = .center view.textAlignment = .center
view.font = UIFont.PFSC_R(ofSize: 13) view.font = UIFont.PFSC_R(ofSize: 13)
view.textColor = UIColor.mainTextColor view.textColor = UIColor.mainTextColor
view.backgroundColor = UIColor(hex: 0xf8f9fb) view.backgroundColor = UIColor.contentBkgColor
view.layer.masksToBounds = true view.layer.masksToBounds = true
view.layer.cornerRadius = 16 view.layer.cornerRadius = 16
return view return view
......
...@@ -28,7 +28,7 @@ class YHBottomNextView: UIView { ...@@ -28,7 +28,7 @@ class YHBottomNextView: UIView {
func setUpView() { func setUpView() {
saveButton = { saveButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor.mainTextColor button.backgroundColor = UIColor.contentBkgColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15) button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal) button.setTitle("保存", for: .normal)
......
...@@ -83,12 +83,12 @@ class YHItemView: UIView { ...@@ -83,12 +83,12 @@ class YHItemView: UIView {
rightButton = { rightButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected) button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.layer.borderWidth = 1 button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x4487f9).cgColor button.layer.borderColor = UIColor.brandMainColor.cgColor
button.isSelected = true button.isSelected = true
button.addTarget(self, action: #selector(rightClick), for: .touchUpInside) button.addTarget(self, action: #selector(rightClick), for: .touchUpInside)
return button return button
...@@ -103,8 +103,8 @@ class YHItemView: UIView { ...@@ -103,8 +103,8 @@ class YHItemView: UIView {
leftButton = { leftButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0xf8f9fb) button.backgroundColor = UIColor.contentBkgColor
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected) button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.addTarget(self, action: #selector(leftClick), for: .touchUpInside) button.addTarget(self, action: #selector(leftClick), for: .touchUpInside)
...@@ -195,49 +195,61 @@ class YHItemView: UIView { ...@@ -195,49 +195,61 @@ class YHItemView: UIView {
leftButton.isSelected = true leftButton.isSelected = true
rightButton.isSelected = false rightButton.isSelected = false
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor leftButton.layer.borderColor = UIColor.brandMainColor.cgColor
leftButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
leftButton.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
rightButton.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
} else { } else {
rightButton.isSelected = true rightButton.isSelected = true
leftButton.isSelected = false leftButton.isSelected = false
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
rightButton.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
leftButton.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
} }
} }
@objc func rightClick() { @objc func rightClick() {
rightButton.isSelected = true rightButton.isSelected = true
leftButton.isSelected = false leftButton.isSelected = false
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
dataSource?.message = "0" dataSource?.message = "0"
dataSource?.value = ["0"] dataSource?.value = ["0"]
if let block = block { if let block = block {
block(dataSource ?? YHItemModel()) block(dataSource ?? YHItemModel())
} }
rightButton.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
leftButton.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
} }
@objc func leftClick() { @objc func leftClick() {
leftButton.isSelected = true leftButton.isSelected = true
rightButton.isSelected = false rightButton.isSelected = false
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor leftButton.layer.borderColor = UIColor.brandMainColor.cgColor
leftButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
dataSource?.message = "1" dataSource?.message = "1"
dataSource?.value = ["1"] dataSource?.value = ["1"]
if let block = block { if let block = block {
block(dataSource ?? YHItemModel()) block(dataSource ?? YHItemModel())
} }
leftButton.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
rightButton.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
} }
@objc func centerClick() { @objc func centerClick() {
......
...@@ -147,7 +147,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -147,7 +147,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
messageTextField = { messageTextField = {
let textField = UITextView() let textField = UITextView()
textField.backgroundColor = UIColor(hex: 0xf8f9fb) textField.backgroundColor = UIColor.contentBkgColor
textField.font = UIFont.PFSC_R(ofSize: 14) textField.font = UIFont.PFSC_R(ofSize: 14)
textField.layer.cornerRadius = 6 textField.layer.cornerRadius = 6
textField.delegate = self textField.delegate = self
......
...@@ -46,7 +46,7 @@ class YHWorkExampleMessageTableViewCell: UITableViewCell { ...@@ -46,7 +46,7 @@ class YHWorkExampleMessageTableViewCell: UITableViewCell {
backgroundColor = .white backgroundColor = .white
centerView = { centerView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0xf8f9fb) view.backgroundColor = UIColor.contentBkgColor
view.layer.cornerRadius = 8 view.layer.cornerRadius = 8
return view return view
}() }()
......
...@@ -71,7 +71,7 @@ class YHWorkExampleTypeView: UIView { ...@@ -71,7 +71,7 @@ class YHWorkExampleTypeView: UIView {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.setTitle(dataSource[i], for: .normal) button.setTitle(dataSource[i], for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setBackgroundColor(color: UIColor(hex: 0xf8f9fb), forState: .normal) button.setBackgroundColor(color: UIColor.contentBkgColor, forState: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13) button.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.tag = 3000 + i button.tag = 3000 + i
......
...@@ -81,12 +81,12 @@ class YHWorkExperienceItemView: UIView { ...@@ -81,12 +81,12 @@ class YHWorkExperienceItemView: UIView {
rightButton = { rightButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected) button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.layer.borderWidth = 1 button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x4487f9).cgColor button.layer.borderColor = UIColor.brandMainColor.cgColor
button.isSelected = true button.isSelected = true
button.addTarget(self, action: #selector(rightClick), for: .touchUpInside) button.addTarget(self, action: #selector(rightClick), for: .touchUpInside)
return button return button
...@@ -101,8 +101,8 @@ class YHWorkExperienceItemView: UIView { ...@@ -101,8 +101,8 @@ class YHWorkExperienceItemView: UIView {
leftButton = { leftButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0xf8f9fb) button.backgroundColor = UIColor.contentBkgColor
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected) button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.layer.cornerRadius = 16 button.layer.cornerRadius = 16
button.addTarget(self, action: #selector(leftClick), for: .touchUpInside) button.addTarget(self, action: #selector(leftClick), for: .touchUpInside)
...@@ -193,17 +193,17 @@ class YHWorkExperienceItemView: UIView { ...@@ -193,17 +193,17 @@ class YHWorkExperienceItemView: UIView {
leftButton.isSelected = true leftButton.isSelected = true
rightButton.isSelected = false rightButton.isSelected = false
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor leftButton.layer.borderColor = UIColor.brandMainColor.cgColor
leftButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
} else { } else {
rightButton.isSelected = true rightButton.isSelected = true
leftButton.isSelected = false leftButton.isSelected = false
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
} }
} }
...@@ -212,9 +212,9 @@ class YHWorkExperienceItemView: UIView { ...@@ -212,9 +212,9 @@ class YHWorkExperienceItemView: UIView {
rightButton.isSelected = true rightButton.isSelected = true
leftButton.isSelected = false leftButton.isSelected = false
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor rightButton.layer.borderColor = UIColor.brandMainColor.cgColor
rightButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
dataSource?.message = "0" dataSource?.message = "0"
dataSource?.value = ["0"] dataSource?.value = ["0"]
...@@ -227,9 +227,9 @@ class YHWorkExperienceItemView: UIView { ...@@ -227,9 +227,9 @@ class YHWorkExperienceItemView: UIView {
leftButton.isSelected = true leftButton.isSelected = true
rightButton.isSelected = false rightButton.isSelected = false
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x4487f9).cgColor leftButton.layer.borderColor = UIColor.brandMainColor.cgColor
leftButton.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
dataSource?.message = "1" dataSource?.message = "1"
dataSource?.value = ["1"] dataSource?.value = ["1"]
......
...@@ -47,7 +47,7 @@ class YHWorkExperienceTextItemView: UIView { ...@@ -47,7 +47,7 @@ class YHWorkExperienceTextItemView: UIView {
messageTextField = { messageTextField = {
let textField = UITextView() let textField = UITextView()
textField.backgroundColor = UIColor(hex: 0xf8f9fb) textField.backgroundColor = UIColor.contentBkgColor
textField.layer.cornerRadius = 4 textField.layer.cornerRadius = 4
textField.delegate = self textField.delegate = self
return textField return textField
......
...@@ -127,7 +127,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -127,7 +127,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
leftButton = { leftButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0xf8f9fb) button.backgroundColor = UIColor.contentBkgColor
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected) button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal) button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("否", for: .normal) button.setTitle("否", for: .normal)
...@@ -152,7 +152,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -152,7 +152,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
} else { } else {
rightButton.isSelected = true rightButton.isSelected = true
...@@ -160,7 +160,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -160,7 +160,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
} }
} }
...@@ -171,7 +171,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -171,7 +171,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
rightButton.layer.borderWidth = 1 rightButton.layer.borderWidth = 1
rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor rightButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08) rightButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
leftButton.backgroundColor = UIColor(hex: 0xf8f9fb) leftButton.backgroundColor = UIColor.contentBkgColor
leftButton.layer.borderWidth = 0 leftButton.layer.borderWidth = 0
} }
...@@ -181,7 +181,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell { ...@@ -181,7 +181,7 @@ class YHWorkMessageSelectTableViewCell: UITableViewCell {
leftButton.layer.borderWidth = 1 leftButton.layer.borderWidth = 1
leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor leftButton.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08) leftButton.backgroundColor = UIColor(hex: 0x2f7ef6).withAlphaComponent(0.08)
rightButton.backgroundColor = UIColor(hex: 0xf8f9fb) rightButton.backgroundColor = UIColor.contentBkgColor
rightButton.layer.borderWidth = 0 rightButton.layer.borderWidth = 0
} }
......
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