美文网首页
17.IBDesignable扩展Inspector面板属性

17.IBDesignable扩展Inspector面板属性

作者: noonez | 来源:发表于2016-04-13 10:36 被阅读19次
    import UIKit
    
    @IBDesignable
    class ExtensionViewInspector: UIView {
    
        /*
        // Only override drawRect: if you perform custom drawing.
        // An empty implementation adversely affects performance during animation.
        override func drawRect(rect: CGRect) {
            // Drawing code
        }
        */
        @IBInspectable var cornerRadius:CGFloat = 0 {
            didSet{
                layer.cornerRadius = cornerRadius
    //            layer.masksToBounds = cornerRadius > 0
            }
        }
    }
    

    相关文章

      网友评论

          本文标题:17.IBDesignable扩展Inspector面板属性

          本文链接:https://www.haomeiwen.com/subject/sabwlttx.html