房间排名和首页搜索房间
This commit is contained in:
@@ -35,22 +35,22 @@ extension UIButton {
|
||||
return bounds.contains(point)
|
||||
}
|
||||
|
||||
static func getCustomBtn(text:String? = nil,selectedText:String? = nil,font:UIFont? = nil,color:UIColor? = nil,selectedColor:UIColor? = nil,image:UIImage? = nil,selectedImage:UIImage? = nil,bgImage:UIImage? = nil) -> UIButton{
|
||||
let customBtn = UIButton()
|
||||
static func getCustomBtn(type:UIButton.ButtonType = .custom, text:String? = nil,selectedText:String? = nil,font:UIFont? = nil,color:UIColor? = nil,selectedColor:UIColor? = nil,image:UIImage? = nil,selectedImage:UIImage? = nil,bgImage:UIImage? = nil,selectedBgImage:UIImage? = nil) -> UIButton{
|
||||
let customBtn = UIButton(type: type)
|
||||
if let _text = text{
|
||||
customBtn.setTitle(text, for: .normal)
|
||||
customBtn.setTitle(_text, for: .normal)
|
||||
}
|
||||
if let _selectedText = selectedText{
|
||||
customBtn.setTitle(selectedText, for: .selected)
|
||||
customBtn.setTitle(_selectedText, for: .selected)
|
||||
}
|
||||
if let _font = font{
|
||||
customBtn.titleLabel?.font = font
|
||||
customBtn.titleLabel?.font = _font
|
||||
}
|
||||
if let _color = color{
|
||||
customBtn.setTitleColor(color, for: .normal)
|
||||
customBtn.setTitleColor(_color, for: .normal)
|
||||
}
|
||||
if let _selectedColor = selectedColor{
|
||||
customBtn.setTitleColor(selectedColor, for: .selected)
|
||||
customBtn.setTitleColor(_selectedColor, for: .selected)
|
||||
}
|
||||
if let _image = image{
|
||||
customBtn.setImage(_image, for: .normal)
|
||||
@@ -61,6 +61,9 @@ extension UIButton {
|
||||
if let _bgImage = bgImage{
|
||||
customBtn.setBackgroundImage(_bgImage, for: .normal)
|
||||
}
|
||||
if let _selectedBgImage = selectedBgImage{
|
||||
customBtn.setBackgroundImage(_selectedBgImage, for: .selected)
|
||||
}
|
||||
return customBtn
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user