From 0b42dcc71a74b34f24505dcaa5142b0c6b637144 Mon Sep 17 00:00:00 2001 From: zeng Date: Fri, 25 Apr 2025 10:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Thimra/Class/Mine/View/SPMineHeaderView.swift | 29 +++++++++++++++++++ Thimra/Source/en.lproj/Localizable.strings | 1 + 2 files changed, 30 insertions(+) diff --git a/Thimra/Class/Mine/View/SPMineHeaderView.swift b/Thimra/Class/Mine/View/SPMineHeaderView.swift index 7619456..814cc46 100644 --- a/Thimra/Class/Mine/View/SPMineHeaderView.swift +++ b/Thimra/Class/Mine/View/SPMineHeaderView.swift @@ -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) diff --git a/Thimra/Source/en.lproj/Localizable.strings b/Thimra/Source/en.lproj/Localizable.strings index 6765d13..2dd8f65 100644 --- a/Thimra/Source/en.lproj/Localizable.strings +++ b/Thimra/Source/en.lproj/Localizable.strings @@ -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";