开发者

make UILabel roundrect shape

开发者 https://www.devze.com 2023-01-17 02:18 出处:网络
How to mak开发者_如何学编程e UIlabelroundRect shape ? By changing background color of UILabel it looks like a rectangle in shape I want to make it look like a roundrect in shape.

How to mak开发者_如何学编程e UIlabel roundRect shape ? By changing background color of UILabel it looks like a rectangle in shape I want to make it look like a roundrect in shape.

Thanks.


first import file

#import <QuartzCore/QuartzCore.h>

and than set the property of UIlabel as

yourLabel.layer.cornerRadius = kCornerRadius;


If you mean to give the label a rounded-rectangle border, you can do that by setting the cornerRadius, borderWidth, and borderColor properties of the label's layer.

0

精彩评论

暂无评论...
验证码 换一张
取 消