iOS 如何让view指定圆角
2017-09-08 11:30
495 查看
UIView *contentView = [[UIView alloc]initWithFrame:CGRectMake((KScreenW-view_W(300))/2,
260/AutoWidth, view_W(300), view_H(250))];
[contentView setBackgroundColor:[UIColor whiteColor]];
[bgView addSubview:contentView];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:contentView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10,
10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = contentView.bounds;
maskLayer.path = maskPath.CGPath;
contentView.layer.mask = maskLayer;
260/AutoWidth, view_W(300), view_H(250))];
[contentView setBackgroundColor:[UIColor whiteColor]];
[bgView addSubview:contentView];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:contentView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10,
10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = contentView.bounds;
maskLayer.path = maskPath.CGPath;
contentView.layer.mask = maskLayer;
相关文章推荐
- iOS TableView如何刷新指定的cell或section
- how to set ImageView fillet 如何设置ImageView为圆角(iOS)
- ios中如何对view画圆角
- iOS: TableView如何刷新指定的cell 或section
- iOS 中如何将View设置为圆角的矩形?
- iOS: TableView如何刷新指定的cell 或section
- iOS View 指定圆角位置
- iOS开发之如何给View添加指定位置的边框线详解
- iOS: TableView如何刷新指定的cell 或section
- iOS 之 TableView如何刷新指定的cell 或section
- IOS如何给VIEW设置2个圆角?set cornerRadius for only top-left and top-right corner of a UIVIEW
- iOS TableView如何刷新指定的cell 或section
- ios中给view添加圆角并指定位置
- 【ios学习记录】-如何定制UITableView的圆角单元格
- iOS: TableView如何刷新指定的cell 或section
- ios tableview iOS: TableView如何刷新指定的cell 或section
- iOS: TableView如何刷新指定的cell 或section
- iOS TableView如何刷新指定的cell 或section
- iOS开发之指定UIView的某几个角为圆角
- iOS (collectionView与tableView并用)添加与删除,如何让人觉得很好玩