Swift 返回一个渐变的 UIImageView
来源:互联网 发布:js e.currenttarget 编辑:程序博客网 时间:2024/06/05 02:15
func createGradientLayer(color : UIColor, width : CGFloat, height : CGFloat) -> UIImageView{ let layer : CAGradientLayer = CAGradientLayer () let gradientColors: [CGColor] = [color.CGColor, UIColor.whiteColor().CGColor] let gradientLocations: [CGFloat] = [0.0, 1.0] layer.colors = gradientColors layer.locations = gradientLocations layer.startPoint = CGPointMake(0, 0) layer.endPoint = CGPointMake(1, 0) layer.frame = CGRectMake(0, 0, width, height) let imageView : UIImageView = UIImageView( imageView.layer.addSublayer(layer) return imageView}
阅读全文
0 0
- Swift 返回一个渐变的 UIImageView
- UIImageView的渐变效果
- Swift创建一个UIImageView
- swift中UIImageView的使用
- swift中UIImageView的使用
- swift:制作一个简单的tableheaderview+_navigationbar渐变效果
- swift:制作一个简单的tableheaderview+_navigationbar渐变效果(二)
- swift UIImageView
- swift UIImageView
- swift UIImageView
- 7、swift中UIImageView的使用方法
- IOS Swift UIImageView图片的填充模式
- Swift - 图像控件(UIImageView)的用法
- Swift - 图像控件(UIImageView)的用法
- Swift -UIButton和UIImageView的用法
- iOS改变UIImageView的image时添加渐变
- iOS编程——Swift实现一个不断渐变的圆环
- 【iOS】彩虹渐变色 的 Swift 实现
- 负载均衡重点业务梳理
- centos 安装 netstat ifconfig
- python去除list中空字符串最快最简单的方法
- Android Studio配置文件路径修改
- PAT (Advanced Level) Practise 1005. Spell It Right (20)
- Swift 返回一个渐变的 UIImageView
- Ubuntu开机无法进入系统问题(NVIDIA显卡驱动相关)
- C#网络编程系列文章(三)之TcpListener实现异步TCP服务器
- Ineger的缓存区
- 工作计划量与实际量的对比, 日期时间
- HTML 状态码
- Vmware安装ubuntu编译android源码详细过程
- jsp的执行过程
- (imx6)tslib编译和qt5调用tslib