当前位置:编程学习 > wap >>

iOS_给uiview等设置圆角

//设置圆角 
zheZhaoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 120, 120)];
 [zheZhaoView setBackgroundColor:[UIColor colorWithWhite:0.3f alpha:0.8f]];
 zheZhaoView.layer.cornerRadius = 10;//设置那个圆角的有多圆
 zheZhaoView.layer.borderWidth = 0;//设置边框的宽度,当然可以不要
 zheZhaoView.layer.borderColor = [[UIColor grayColor] CGColor];//设置边框的颜色
 zheZhaoView.layer.masksToBounds = YES;
 [self addSubview:zheZhaoView];

 

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,