Last active
January 14, 2022 08:45
-
-
Save hanfengs/72a24d37018fd44c32837064ee009f51 to your computer and use it in GitHub Desktop.
[文字描边] #swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.jianshu.com/p/5c3883bdfd7e | |
let startLabel = UICreateTools.createLabel(frame: .zero, text: "string_start".localization, font: UIFont.mainFont(size: 12, weight: .heavy), textColor: .white, alignment: .right) | |
// startLabel.addBorder(1, color: UIColor(red: 62, green: 0, blue: 255)) | |
self.view.addSubview(startLabel) | |
startLabel.snp.makeConstraints { make in | |
make.centerY.equalTo(startDate24Button) | |
make.trailing.equalTo(startDate24Button.snp.leading).offset(-4) | |
} | |
let startButton = UIButton(type: .custom) | |
startButton.layer.cornerRadius = 12 | |
startButton.layer.masksToBounds = true | |
startButton.layer.borderWidth = 2 | |
startButton.layer.borderColor = UIColor(red: 62, green: 0, blue: 255).cgColor | |
startButton.backgroundColor = UIColor(red: 0, green: 248, blue: 155) | |
startButton.addTarget(self, action: #selector(startDateButtonClick(_ :)), for: .touchUpInside) | |
self.view.insertSubview(startButton, belowSubview: startDate24Button) | |
startButton.snp.makeConstraints { make in | |
make.centerY.equalTo(startDate24Button) | |
make.trailing.equalTo(startDate24Button).offset(8) | |
make.leading.equalTo(startLabel).offset(-8) | |
make.height.equalTo(28) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment