UIView 添加闪烁的渐变光
CGRect gradientRect=CGRectMake(- imageView3.bounds.size.width*1.5, , * imageView3.bounds.size.width, imageView3.bounds.size.height);
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.frame =gradientRect;
gradientLayer.colors = @[(id)hexColor(bb975e).CGColor,(id)[UIColor whiteColor].CGColor,(id)hexColor(bb975e).CGColor];
gradientLayer.locations = @[@(0.25),@(0.5),@(0.75)];
gradientLayer.startPoint = CGPointMake(, 0.5);
gradientLayer.endPoint = CGPointMake(, 0.5);
gradientLayer.position = CGPointMake(imageView3.bounds.size.width*0.5, imageView3.bounds.size.height/2.0);
[imageView3.layer addSublayer:gradientLayer]; CALayer *maskLayer = [CALayer layer];
maskLayer.frame =CGRectOffset(imageView3.bounds, imageView3.bounds.size.width*1.5, );
maskLayer.contents = (__bridge id)([UIImage imageNamed:@"launchImage3"].CGImage);
gradientLayer.mask = maskLayer; CABasicAnimation* fadeAnim = [CABasicAnimation animationWithKeyPath:@"locations"];
fadeAnim.fromValue = @[@(0.0),@(0.0),@(0.25)];
fadeAnim.toValue = @[@(0.75),@(1.0),@(1.0)];
fadeAnim.duration=;
fadeAnim.repeatCount = CGFLOAT_MAX;
[gradientLayer addAnimation:fadeAnim forKey:nil];
UIView 添加闪烁的渐变光的更多相关文章
- 【Swift 2.1】为 UIView 添加点击事件和点击效果
前言 UIView 不像 UIButton 加了点击事件就会有点击效果,体验要差不少,这里分别通过自定义和扩展来实现类似 UIButton 的效果. 声明 欢迎转载,但请保留文章原始出处:) 博客园: ...
- 给UIView添加手势
对于不能addTarget的UI对象,添加手势为他们带来了“福音”,以为UIView添加手势为例,揭开手势的面目. 1,创建一个view先, UIView * jrView=[[UIViewalloc ...
- iOS 中 为UIView添加背景图片
创建UIImage的方法有两种: UIImage *image = [UIImageimageNamed:@"image.jpg"];//这种不释放内存,要缓存 NSString ...
- [BS-29] 给UIView添加背景图片
给UIView添加背景图片 //默认情况下只能设置UIView的背景颜色,不能给UIView设置背景图片,但通过绘图知识可以做到 - (void)drawRect:(CGRect)rect { [su ...
- IOS学习之路十五(UIView 添加背景图片以及加边框)
怎样给UIview添加背景图片呢很简单,就是先给view添加一个subview,然后设为背景图片: 效果图如下: 很简单直接上代码: //设置内容 self.myTopView.backgroundC ...
- UIView添加支持代码块的手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(a ...
- IOS UIView圆角,阴影,边框,渐增光泽
圆角 sampleView.layer.cornerRadius = 2.5; // 圓角的弧度sampleView.layer.masksToBounds = YES; 阴影 sampleView. ...
- IOS开发之功能模块--给任意的UIView添加点击事件
前言:好久没写博客,今天来一波.我在实际项目开发中,会遇到这样功能需求:我已经搭好了iOS的UI界面,但是很多界面的子View用了UIView,然后这些UIView中用了UILabel和UIImage ...
- swift为UIView添加extension扩展frame
添加swift file:UIView+Extension import UIKit extension UIView { // x var x : CGFloat { get { return fr ...
随机推荐
- mpvue使用vant Weapp运行npm run build命令打包后失效
最近在使用mpvue开发微信小程序,在开发过程中使用有赞的小程序ui框架—— vant Weapp ,至于如何使用在我个人博客中有一篇关于如何使用vant Weapp ,需要的同学请点进这里自行查看. ...
- Spring的InitializingBean与DisposableBean方法
在bean初始化的时候,将所有显示提供的属性设置完毕后调用这个方法 org.springframework.beans.factory.InitializingBean#afterProperties ...
- Flume学习之路 (三)Flume的配置方式
一.单一代理流配置 1.1 官网介绍 http://flume.apache.org/FlumeUserGuide.html#avro-source 通过一个通道将来源和接收器链接.需要列出源,接收器 ...
- Scala学习之路 (三)Scala的基本使用
一.Scala概述 scala是一门多范式编程语言,集成了面向对象编程和函数式编程等多种特性.scala运行在虚拟机上,并兼容现有的Java程序.Scala源代码被编译成java字节码,所以运行在JV ...
- Metabase在Windows下的开发环境配置
Metabase在Windows下的开发环境配置 */--> pre.src {background-color: #292b2e; color: #b2b2b2;} Metabase在Wind ...
- elk平台定制化查询规则
一.查询某IP在某时间内TOP10的请求 步骤: 点击“Visualize”选项卡 创建“Data table” 点击“From a new search” 下拉选择“F5-access” 在“buc ...
- 3-(基础入门篇)稍微了解一下(需要知道的关于Lua的一些基本的知识)
http://www.cnblogs.com/yangfengwu/p/8948935.html 基础教程源码链接如果失效,请在淘宝介绍中下载,由于链接很容易失效,如果失效请联系卖家,谢谢 htt ...
- js倒计时,页面刷新时,不会从头计时
最近不忙,瞎鼓捣...哈哈 这里利用了H5的本地存储 localStorage,取秒数直接用了php的time()方法,就懒得用js取了. 把第一次访问页面时的时间存在客户端,然后再刷新的时候,比较用 ...
- vi 格式配置
echo set cursorline >>.vimrcecho set ic >>.vimrcecho set nu >>.vimrc
- Bat 参数去引号(各种去引号的奇葩方式,三种变量互转),普通变量不能直接去掉外层引号
很多情况下,我们需要脱除一个字符串中可能会存在的引号,然后在加上自己的引 号使其中的特殊字符(命令连接符& .| .&&.||,命令行参数界定符Space .tab . ; . ...