设置UIView圆角的拓展
来源:互联网 发布:snapchat网络无法连接 编辑:程序博客网 时间:2024/06/10 04:09
- @interface UIView (RectCorner)
- @end
- @implementation UIView (RectCorner)
- - (void)setCornerOnTop {
- UIBezierPath *maskPath;
- maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds
- byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight)
- cornerRadii:CGSizeMake(10.0f, 10.0f)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = self.bounds;
- maskLayer.path = maskPath.CGPath;
- self.layer.mask = maskLayer;
- [maskLayer release];
- }
- - (void)setCornerOnBottom {
- UIBezierPath *maskPath;
- maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds
- byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight)
- cornerRadii:CGSizeMake(10.0f, 10.0f)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = self.bounds;
- maskLayer.path = maskPath.CGPath;
- self.layer.mask = maskLayer;
- [maskLayer release];
- }
- - (void)setAllCorner {
- UIBezierPath *maskPath;
- maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds
- cornerRadius:10.0];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = self.bounds;
- maskLayer.path = maskPath.CGPath;
- self.layer.mask = maskLayer;
- [maskLayer release];
- }
- - (void)setNoneCorner{
- self.layer.mask = nil;
- }
- @end
0 0
- 设置UIView圆角的拓展
- 设置UIView圆角的拓展
- 设置UIView圆角的拓展
- 设置UIView圆角的拓展
- IOS UIView--动画、圆角的拓展
- UIView的圆角设置
- UIView设置圆角
- UIView 设置圆角
- UIView 设置圆角
- UIVIEW圆角设置
- UIView 设置圆角
- UIView 设置圆角
- uiView 设置圆角
- UIView设置圆角
- UIVIew设置圆角
- 设置UIview的圆角效果
- UIView部分圆角设置
- UIVIEW如何设置圆角
- yii excel上传验证
- xml—约束(DTD)
- 玩转Android Studio
- ScrollView嵌套listView问题
- Apache Maven 入门篇(下)
- 设置UIView圆角的拓展
- CodeForces-672A-Summer Camp
- 根据B表数据更新A表
- CocurrentHashMap和Hashtable的区别
- 网络编程(二)
- MFC 基于多文档的打印和打印预览功能的实现
- Python 面向对象 —— 特殊函数
- Android关于透明度对应表
- RTTI