swift
紫月照落叶
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
自定义button的init方法
class WBButton: UIButton { convenienceinit(text: String , fontSize:CGFloat , normalColor: UIColor , highlightedColor: UIColor , backgroundImageName: String) { self.init()原创 2017-05-02 02:16:15 · 947 阅读 · 0 评论 -
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 · 264 阅读 · 0 评论 -
纯代码布局控件
private func setUI() { addSubview(iconView)//添加控件 for view in subviews {//遍历所用控件并设置可以使用addConstrain布局,如果没有这句代码则下面的布局代码无效。 view.translatesAutoresizingMaskIntoConstraints = fal原创 2017-04-27 20:54:11 · 364 阅读 · 0 评论 -
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 · 228 阅读 · 0 评论 -
设置属性setter方法
var visitorInfo: [String :String]? { didSet{ guardlet imageName = visitorInfo?["imageName"], let message = visitorInfo?["message"] e原创 2017-04-27 21:51:22 · 619 阅读 · 0 评论
分享