UIView设置指定角为圆角的代码
2016-06-23 09:48
351 查看
提供一个UIView设置指定角为圆角的代码,可以在按钮上试试,如果不行的话可以考虑将按钮换成UIView,给UIView加个单击手势,希望对你有帮助!
UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(30, CGRectGetMaxY(pickerView.frame), With-60, 50)];
whiteView.backgroundColor = [UIColor whiteColor];
UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:whiteView.bounds byRoundingCorners:UIRectCornerBottomLeft
| UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = whiteView.bounds;
maskLayer1.path = maskPath1.CGPath;
whiteView.layer.mask = maskLayer1;
UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(30, CGRectGetMaxY(pickerView.frame), With-60, 50)];
whiteView.backgroundColor = [UIColor whiteColor];
UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:whiteView.bounds byRoundingCorners:UIRectCornerBottomLeft
| UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = whiteView.bounds;
maskLayer1.path = maskPath1.CGPath;
whiteView.layer.mask = maskLayer1;
相关文章推荐
- 应用Druid监控SQL语句的执行情况
- vue.js快速上手。
- 修改UITextfield的Placeholder字体的颜色
- iOS UITextView 限制最大输入字数
- iOS-你真的会用UIMenuController吗?(详细)
- android stuido使用以及markdown编辑器语法
- LeetCode-62-Unique Paths
- QueryPerformanceCounter函数
- RegQueryValueEx函数
- RegSetValueEx和RegDeleteValue函数
- CreateIoCompletionPort和GetQueuedCompletionStatus函数
- HDFS UserGuide
- 关键字彩蛋动画的实现(讲解+DEMO)
- UGUI Scrollrect滚动优化:无限循环利用
- Android UI设计技巧
- serialVersionUID 作用
- std::unique函数的使用
- Leet Code 51 N-Queens - N皇后问题 - Java
- Leet Code 52 N-Queens II - N皇后问题 - Java
- [一句秒懂] iOS8.0-UIAlertController介绍