//设置圆角
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];
请记得包含#import <QuartzCore/QuartzCore.h>
和该framework文件
本文介绍如何在iOS应用中使用Swift实现带有圆角、边框颜色及宽度的自定义视图效果,并确保视图的圆角效果平滑过渡。
863

被折叠的 条评论
为什么被折叠?



