房间排名和首页搜索房间

This commit is contained in:
liyuhua
2024-03-22 11:54:23 +08:00
parent 56b6f40526
commit 6c2c5d586a
66 changed files with 1644 additions and 114 deletions

View File

@@ -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
}