使用CALayer自定义UIButton边框
来源:互联网 发布:淘宝全球购入口在哪里 编辑:程序博客网 时间:2024/05/16 08:04
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];btn.frame = CGRectMake(0, 0, 80, 40);[btn.layer setMasksToBounds:YES];[btn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径[btn.layer setBorderWidth:5.0]; //边框宽度CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 1, 0, 0, 1 }); [btn.layer setBorderColor:colorref];//边框颜色[self.view addSubview:btn]; 还可以设置CALayer的其它属性,详情查看CALayer帮助文档
转载自 http://blog.sina.com.cn/s/blog_5c5c87d801012izr.html
0 0
- 使用CALayer自定义UIButton边框
- 使用CALayer自定义UIButton边框
- 使用CALayer自定义UIButton边框
- 为UIButton添加边框,使用CALayer
- 使用CALayer设置图像边框
- CALayer自定义
- uibutton设置边框
- UIButton加彩色边框
- 边框(UIbutton UItextfiled)
- 自定义UIButton
- UIButton 自定义
- 自定义UIButton
- 自定义UIButton
- 自定义UIButton
- CALayer 圆角化、阴影、边框
- 动画—CALayer的初步学习四:CALayer绘图—使用自定义图层绘图
- IOS 圆形头像 UIButton边框 按钮边框
- CALayer的使用(圆形头像 锚点 边框 阴影 形变 隐式动画 )
- J2EE连接oracle莫名其妙出现问题
- java中static作用详解
- 数据结构之魔术师的发牌
- Ubuntu 12.04安装Google Chrome
- Microsoft Office 2013 Professional Plus官方MSDN正式版下载合集 64 32位原版镜像iso
- 使用CALayer自定义UIButton边框
- ubuntu终端常用快捷键
- 阿里巴巴面试题-重男轻女概率题
- JS改变鼠标样式
- 希尔排序-转自java数据结构和算法
- 数据交换算法比较
- Linux常用头文件
- 数理逻辑--归纳与演绎
- Java 调用新浪微博API int64类型 参数传入方法