How to set rectangle border for custom type UIButton

前端 未结 6 533
臣服心动
臣服心动 2020-12-28 08:55

I am trying to set an image as the background of a custom UIButton. I was able to set a background image for the \"rounded rect\" UIButton in interface builder, but now the

6条回答
  •  时光取名叫无心
    2020-12-28 09:29

    I'd just like to add to the answers provided by nanshi and Jonathan.

    In order to access the border and cornerRadius properties of the layer you will first need to import the QuartzCore framework.

    #import

    Otherwise you will not be able to access the properties.

提交回复
热议问题