设置UIView圆角的拓展
来源:互联网 发布:js求两个集合的并集 编辑:程序博客网 时间:2024/05/19 09:16
@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如何设置圆角
- HDU 1860 统计字符
- java中Frame框架关闭按钮和框架居中的设置方法
- 新手学Android之如何以正确的姿势debug
- UVA The die is cast (BFS)
- 总结了一下自己,我就是喜欢学习,喜欢编程
- 设置UIView圆角的拓展
- oVirt 中的存储管理
- 安全策略的使用,让指定IP可以连接SQLSERVER
- 关于ping程序
- 学习MongoDB过程中零散的知识
- iOS UIButton imageView图片无法显示
- dp 这个单位是安卓发明的么?为什么 px=dp*(dpi/160)?
- 练习总结
- JSONModel