登录按钮

This commit is contained in:
zeng 2025-04-25 10:04:51 +08:00
parent 566c21ad40
commit 0b42dcc71a
2 changed files with 30 additions and 0 deletions

View File

@ -92,6 +92,20 @@ class SPMineHeaderView: UIView {
return view
}()
private lazy var loginButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("Log in".localized, for: .normal)
button.setTitleColor(.colorFFFFFF(), for: .normal)
button.titleLabel?.font = .fontMedium(ofSize: 16)
button.setBackgroundImage(UIImage(color: .colorFFFFFF(alpha: 0.23)), for: .normal)
button.layer.cornerRadius = 15
button.layer.masksToBounds = true
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.colorFFFFFF().cgColor
button.addTarget(self, action: #selector(handleLoginButton), for: .touchUpInside)
return button
}()
override init(frame: CGRect) {
super.init(frame: frame)
@ -107,6 +121,11 @@ class SPMineHeaderView: UIView {
}
@objc private func handleLoginButton() {
}
}
extension SPMineHeaderView {
@ -116,6 +135,7 @@ extension SPMineHeaderView {
addSubview(nicknameLabel)
addSubview(idLabel)
addSubview(copyButton)
addSubview(loginButton)
addSubview(stackView)
avatarImageView.snp.makeConstraints { make in
@ -143,6 +163,15 @@ extension SPMineHeaderView {
make.width.equalTo(copyWidth)
}
let loginWidth = (loginButton.currentTitle?.size(font: loginButton.titleLabel?.font ?? .fontRegular(ofSize: 12)).width ?? 0) + 28
loginButton.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.height.equalTo(30)
make.width.equalTo(76)
make.centerY.equalTo(avatarImageView)
}
stackView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(kSPStatusbarHeight + 108)

View File

@ -49,5 +49,6 @@
"Youth Civilization Convention" = "Youth Civilization Convention";
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
"Log in" = "Log in";