赞
踩
常见设置:
lazy private var messageTitleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.black
label.backgroundColor = .clear
label.textAlignment = NSTextAlignmentCenter;
label.font = UIFont.systemFont(ofSize: 10)
label.numberOfLines = 0
return label
}()
常见设置:
lazy private var button: UIButton = {
let button = UIButton(type: .custom)
button.backgroundColor = .clear
button.setTitle("详情", for: .normal)
button.imageEdgeInsets = UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 50)
button.titleEdgeInsets = UIEdgeInsets.init(top: 0, left: -50, bottom: 0, right: 0)
button.setTitleColor(.orange, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 10)
copyButton.layer.cornerRadius = 10
copyButton.layer.masksToBounds = true
copyButton.layer.borderColor = UIColor.orange.cgColor
copyButton.layer.borderWidth = 1.0
return button
}()
self.selectionStyle = .none
self.tableView.separatorStyle = .none
self.tableView.register(WMCommunitySendCodeTableViewCell.self, forCellReuseIdentifier: "cell")
func RGB(r: CGFloat, g: CGFloat, b: CGFloat, alpha: CGFloat) -> UIColor {
return UIColor (red: r/225.0, green: g/225.0, blue: b/225.0, alpha: alpha)
}
func kScale(_ num: CGFloat) -> CGFloat {
return num * screenWidth / 375
}
ios开发生命周期分UIViewController生命周期和App的生命周期,掌握的意义在于熟悉程序的执行过程。
生命周期
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。