登录按钮
This commit is contained in:
parent
566c21ad40
commit
0b42dcc71a
@ -92,6 +92,20 @@ class SPMineHeaderView: UIView {
|
|||||||
return view
|
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) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
@ -107,6 +121,11 @@ class SPMineHeaderView: UIView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func handleLoginButton() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SPMineHeaderView {
|
extension SPMineHeaderView {
|
||||||
@ -116,6 +135,7 @@ extension SPMineHeaderView {
|
|||||||
addSubview(nicknameLabel)
|
addSubview(nicknameLabel)
|
||||||
addSubview(idLabel)
|
addSubview(idLabel)
|
||||||
addSubview(copyButton)
|
addSubview(copyButton)
|
||||||
|
addSubview(loginButton)
|
||||||
addSubview(stackView)
|
addSubview(stackView)
|
||||||
|
|
||||||
avatarImageView.snp.makeConstraints { make in
|
avatarImageView.snp.makeConstraints { make in
|
||||||
@ -143,6 +163,15 @@ extension SPMineHeaderView {
|
|||||||
make.width.equalTo(copyWidth)
|
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
|
stackView.snp.makeConstraints { make in
|
||||||
make.left.right.equalToSuperview()
|
make.left.right.equalToSuperview()
|
||||||
make.top.equalToSuperview().offset(kSPStatusbarHeight + 108)
|
make.top.equalToSuperview().offset(kSPStatusbarHeight + 108)
|
||||||
|
@ -49,5 +49,6 @@
|
|||||||
"Youth Civilization Convention" = "Youth Civilization Convention";
|
"Youth Civilization Convention" = "Youth Civilization Convention";
|
||||||
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
|
"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";
|
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
|
||||||
|
"Log in" = "Log in";
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user