xib or storyboard add rounded corners or borders

Recent projects to use this, so give yourself a note

 

  • Set to add View add, and then set the layer.cornerRadius property values, the category is String

 

 

  •  UILabel so setting has no effect, you need to add clipsToBounds property value is set to YES

 

 

 

  • If you need to set the border layer.borderWidth property, class is String 

 

 

Set the border color does not work, because there is no CGColor option, it needs its own new category integrated UILayer, set the path of color

running result:

 

Guess you like

Origin www.cnblogs.com/hualuoshuijia/p/11775817.html