- 博客(6)
- 收藏
- 关注
原创 自定义button的init方法
class WBButton: UIButton { convenience init(text: String , fontSize: CGFloat , normalColor: UIColor , highlightedColor: UIColor , backgroundImageName: String) { self.init()
2017-05-02 02:16:15 856
原创 设置属性setter方法
var visitorInfo: [String : String]? { didSet{ guard let imageName = visitorInfo?["imageName"], let message = visitorInfo?["message"] e
2017-04-27 21:51:22 533
原创 纯代码布局控件
private func setUI() { addSubview(iconView)//添加控件 for view in subviews {//遍历所用控件并设置可以使用addConstrain布局,如果没有这句代码则下面的布局代码无效。 view.translatesAutoresizingMaskIntoConstraints = fal
2017-04-27 20:54:11 304
原创 CABasicAnimation的使用
private func iconAnimation() { let anim = CABasicAnimation(keyPath: "transform.rotation") anim.toValue = 2 * M_PI anim.duration = 15 anim.repeatCount =
2017-04-27 20:47:43 145
原创 UILabel常用的属性设置
label.text = text //文本内容 label.font = UIFont.systemFont(ofSize: 14) //字体大小 label.textColor = color //字体颜色 label.numberOfLines = 0 //自动换行 label.textAlignment = .center //文本居中显示
2017-04-25 17:46:14 209
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人