0
点赞
收藏
分享

微信扫一扫

IOS设置UIView的边框和圆角


iOS 系统自带的 View 组件都是正方形的,看起来都太生硬,有时候我需要加边框变成圆角形式,代码实现:

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 80, 80)];
view.layer.cornerRadius = 10;
view.layer.masksToBounds = YES;
view.layer.borderWidth = 1;

view.layer.borderColor = [[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1] CGColor];

举报

相关推荐

0 条评论