UIVIew设置圆角
2017-08-14 15:59
204 查看
UIView *aView = [[UIView alloc] init];
UIView *aView = [[UIView alloc] init];
aView.frame = CGRectMake(0, 0, 300, 200); aView.backgroundColor = [UIColor redColor]; //设置圆角边框 aView.layer.cornerRadius = 8; aView.layer.masksToBounds = YES; //设置边框及边框颜色 aView.layer.borderWidth = 8; aView.layer.borderColor =[ [UIColor grayColor] CGColor]; [self.view addSubview:aView];
UIView *aView = [[UIView alloc] init];
aView.frame = CGRectMake(0, 0, 300, 200); aView.backgroundColor = [UIColor redColor]; [self.view addSubview:aView]; //设置所需的圆角位置以及大小 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:aView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = aView.bounds; maskLayer.path = maskPath.CGPath; aView.layer.mask = maskLayer;
相关文章推荐
- 设置UIView圆角的拓展
- 设置UIView圆角 cornerRadius 圆角有性能问题,用贝塞尔曲线代替
- XIB 设置UIView的圆角边框等属性
- iOS中UIView半边圆角设置
- XIB中设置UIView圆角
- iOS中UIView半边圆角设置
- UIView的圆角设置
- UIView,UIButton,UIImageView等设置圆角,设置阴影,设置边框的方法
- 设置UIView为圆角矩形
- ios开发——给uiview等设置圆角
- iOS开发之设置UIView边框颜色及边线厚度以及圆角及弧度
- UIView 设置圆角
- 设置uiview圆角与阴影
- ios学习笔记:UIView设置为圆角
- iOS小技巧 - 设置UIView的样式为圆角矩形
- UIVIEW如何设置圆角
- UIView,UIButton,UIImageView等设置圆角,设置阴影,设置边框的方法
- UIview 设置指定的几个角为圆角
- ios中如何将UIView设置为圆角
- IOS设置UIView的边框为圆角