写一个UIView扩展

1. .h文件

@interface UIView (Corner)

- (void)setCornerWithType:(UIRectCorner)type
Radius:(CGFloat)radius; @end

2. .m文件

#import "UIView+Corner.h"

@implementation UIView (Corner)

- (void)setCornerWithType:(UIRectCorner)type
Radius:(CGFloat)radius {
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:type cornerRadii:CGSizeMake(radius,radius)];
CAShapeLayer *layer = [[CAShapeLayer alloc] init];
layer.frame = self.bounds;
layer.path = path.CGPath;
self.layer.mask = layer;
} @end

最新文章

  1. 【API】获取优酷视频信息接口
  2. $.each 和$(selector).each()的区别
  3. WebApi:路由和Action选择
  4. HDU 4341 分组背包
  5. overflow的劲爆知识点
  6. 【H5开发基础】移动端1像素边框问题的解决方案
  7. LVS负载均衡的三种模式和八种算法总结
  8. 【Sql】mySQL在windows环境启动
  9. 关于linux音频指南
  10. PHP删除数组中空值的方法介绍
  11. 添加一个Android框架层的系统服务与实现服务的回调
  12. Spring Boot系列——7步集成RabbitMQ
  13. 搭建Fabric网络(三)artifacts是怎么生成的:cryptogen和configtxgen
  14. !! zcl_TD 用法注释02 力攻(动能<4)
  15. 谷歌的java文本差异对比工具
  16. SharePoint Designer 配置工作流后需要重启的问题
  17. C语言基础第二次作业
  18. django -admin 源码解析
  19. 针对石家庄铁道大学官网首页的UI分析
  20. git sourcetree忽略某些文件提交

热门文章

  1. 1057 Stack (30)(30 分)
  2. test20190611 NOIP模拟赛
  3. IronPython 源码剖析系列(1):IronPython 编译器
  4. C/C++面试题总结(1)
  5. sessionStorage,localStorage,cookies
  6. #include <deque>
  7. 【转】Pro Android学习笔记(四六):Dialog(3):对话框弹对话框
  8. TS学习之基础类型
  9. 关于使用struts2跳转后css和js失效的解决方式
  10. Mac系统的launchd、守护进程daemon(2013笔记整理)