51 lines
1.0 KiB
Swift
51 lines
1.0 KiB
Swift
//
|
|
// SPHomeSearchButton.swift
|
|
// Thimra
|
|
//
|
|
// Created by 曾觉新 on 2025/4/17.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class SPHomeSearchButton: UIControl {
|
|
|
|
|
|
override var intrinsicContentSize: CGSize {
|
|
return CGSize(width: kSPScreenWidth, height: 38)
|
|
}
|
|
|
|
private lazy var iconImageView: UIImageView = {
|
|
let imageView = UIImageView(image: UIImage(named: "search_icon_01"))
|
|
return imageView
|
|
}()
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
layer.cornerRadius = 19
|
|
layer.masksToBounds = true
|
|
|
|
backgroundColor = .colorFFFFFF(alpha: 0.1)
|
|
|
|
_setupUI()
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
}
|
|
|
|
extension SPHomeSearchButton {
|
|
|
|
private func _setupUI() {
|
|
addSubview(iconImageView)
|
|
|
|
iconImageView.snp.makeConstraints { make in
|
|
make.centerY.equalToSuperview()
|
|
make.left.equalToSuperview().offset(15)
|
|
}
|
|
}
|
|
|
|
|
|
}
|