美文网首页
如何给控件设置圆角及边框

如何给控件设置圆角及边框

作者: 奋撸小菜鸟 | 来源:发表于2016-06-13 18:03 被阅读103次

    方法一:代码直接控制

        /** 设置圆角及边框 */
        self.setButton.layer.masksToBounds = YES;
        self.setButton.layer.cornerRadius  = 4.0f;
        self.setButton.layer.borderWidth   = 1.0f;
        self.setButton.layer.borderColor   = [UIColor lightGrayColor].CGColor;
    

    方法二:xib中设置(直接上图)

    image

    填写的几个属性值为:

        layer.masksToBounds
        layer.cornerRadius
        layer.borderWidth
        layer.borderColorFromUIColor
    

    相关文章

      网友评论

          本文标题:如何给控件设置圆角及边框

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