Shimmer辉光动画效果
Shimmer辉光动画效果
效果
源码
https://github.com/facebook/Shimmer
https://github.com/YouXianMing/Animations
//
// ShimmerController.m
// Animations
//
// Created by YouXianMing on 15/12/18.
// Copyright © 2015年 YouXianMing. All rights reserved.
// #import "ShimmerController.h"
#import "UIView+SetRect.h"
#import "FBShimmeringLayer.h"
#import "FBShimmeringView.h"
#import "StrokeCircleLayerConfigure.h" @interface ShimmerController () @end @implementation ShimmerController - (void)setup { [super setup]; self.backgroundView.backgroundColor = [UIColor blackColor]; {
FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.contentView.bounds];
shimmeringView.shimmering = YES;
shimmeringView.shimmeringBeginFadeDuration = 0.3;
shimmeringView.shimmeringOpacity = 0.3;
[self.contentView addSubview:shimmeringView]; UILabel *logoLabel = [[UILabel alloc] initWithFrame:shimmeringView.bounds];
logoLabel.text = @"Shimmer";
logoLabel.font = [UIFont fontWithName:@"HelveticaNeue-UltraLight" size:60.0];
logoLabel.textColor = [UIColor whiteColor];
logoLabel.textAlignment = NSTextAlignmentCenter;
logoLabel.backgroundColor = [UIColor clearColor];
shimmeringView.contentView = logoLabel;
} {
FBShimmeringLayer *shimmeringLayer = [FBShimmeringLayer layer];
shimmeringLayer.frame = (CGRect){CGPointZero, CGSizeMake(( + ) * , ( + ) * )};
shimmeringLayer.position = self.contentView.center;
shimmeringLayer.shimmering = YES;
shimmeringLayer.shimmeringBeginFadeDuration = 0.3;
shimmeringLayer.shimmeringOpacity = 0.3;
shimmeringLayer.shimmeringPauseDuration = 0.6f;
[self.contentView.layer addSublayer:shimmeringLayer]; CAShapeLayer *circleShape = [CAShapeLayer layer];
StrokeCircleLayerConfigure *config = [StrokeCircleLayerConfigure new];
config.lineWidth = .f;
config.startAngle = ;
config.endAngle = M_PI * ;
config.radius = .f;
config.strokeColor = [UIColor redColor];
[config configCAShapeLayer:circleShape]; shimmeringLayer.contentLayer = circleShape;
}
} - (void)buildTitleView { [super buildTitleView]; // Title label.
UILabel *headlinelabel = [UILabel new];
headlinelabel.font = Font_Avenir(.f);
headlinelabel.textAlignment = NSTextAlignmentCenter;
headlinelabel.textColor = [UIColor redColor];
headlinelabel.text = self.title;
[headlinelabel sizeToFit]; headlinelabel.center = self.titleView.middlePoint; FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.titleView.bounds];
shimmeringView.shimmering = YES;
shimmeringView.shimmeringBeginFadeDuration = 0.3;
shimmeringView.shimmeringOpacity = 0.3;
[self.titleView addSubview:shimmeringView]; shimmeringView.contentView = headlinelabel; // Line.
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(, 63.5, self.view.width, 0.5f)];
line.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:0.25f];
[self.titleView addSubview:line];
[self.titleView addSubview:headlinelabel]; // Back button.
UIImage *image = [UIImage imageNamed:@"backIconVer2"];
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(, , , )];
backButton.center = CGPointMake(, self.titleView.middleY);
[backButton setImage:image forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(popSelf) forControlEvents:UIControlEventTouchUpInside];
[backButton.imageView setContentMode:UIViewContentModeCenter];
[self.titleView addSubview:backButton];
} - (void)popSelf { [self popViewControllerAnimated:YES];
} @end
细节
Shimmer辉光动画效果的更多相关文章
- 使用CALayer制作View的辉光效果
使用CALayer制作View的辉光效果 实现以下的辉光效果: 思路是这样子的: 1. 创建好需要实现辉光效果的View 2. 对这个View进行截图 3. 将这个截图重新添加进View中 4. 对这 ...
- iOS之UI--辉光动画
前言:学习来自YouXianMing老师的博客:<辉光UIView的category>以及YouXianMing老师的github源码:< GlowView > 而我个人 ...
- jquery添加光棒效果的各种方式以及简单动画复杂动画
过滤器.绑定事件.动画 一.基本过滤器 语法 描述 返回值 :first 选取第一个元素 单个元素 :last 选取最后一个元素 单个元素 :not(selector) 选取去除所有与给定选择器匹 ...
- 支持辉光效果的Label
支持辉光效果的Label 效果 源码 https://github.com/YouXianMing/UI-Component-Collection 中的 FBGlowLabel // // FBGlo ...
- GraphicsLab Project之辉光(Glare,Glow)效果 【转】
作者:i_dovelemon 日期:2016 / 07 / 02 来源:CSDN 主题:Render to Texture, Post process, Glare, Glow, Multi-pass ...
- 辉光UIView的category
辉光UIView的category 本人视频教程系类 iOS中CALayer的使用 效果如下: 源码: UIView+GlowView.h 与 UIView+GlowView.m // // UI ...
- iOS酷炫动画效果合集
iOS酷炫动画效果合集 源码地址 https://github.com/YouXianMing/Animations 效果绝对酷炫,包含了多种多样的动画类型,如POP.Easing.粒子效果等等,虽然 ...
- 辉光的UIView
辉光的UIView 辉光UIView使用了一个UIView的一个category,名为UIView+Glow,请自行到github上查找. 源码如下: // // RootViewController ...
- Android Shimmer 发光微光动画
这是Facebook提供的一个类库(题外话http://code.facebook.com,这里有很多好玩有趣有用的Facebook开源的类库) 这么炫酷的发光动画效果,想必很多Android码农都会 ...
随机推荐
- 更改Chrome浏览器安装位置的方法
因为Google Chrome独特的优势,我们很多人都在使用它,但同时我们也会发现它是默认安装在我们的系统盘的,那么是否就不能修改其安装路径了呢?其实不然,这里介绍一种方法,亲测可行. 一.正常安装 ...
- 基于CommonsChunkPlugin,webpack打包优化
前段时间一直在基于webpack进行前端资源包的瘦身.在项目中基于路由进行代码分离,http://www.cnblogs.com/legu/p/7251562.html.但是打包的文件还是很大,特别是 ...
- OpenCV持久化(二)
如何利用OpenCV持久化自己的数据结构?我们来看看OpenCV中的一个例子. MyData.hpp定义自己的数据结构MyData如下: #ifndef MYDATA_HPP #define MYDA ...
- PCA(Principal Component Analysis)主成分分析
PCA的数学原理(非常值得阅读)!!!! PCA(Principal Component Analysis)是一种常用的数据分析方法.PCA通过线性变换将原始数据变换为一组各维度线性无关的表示,可 ...
- too many open file /etc/security/limits.conf
当出现too mang open file 时更改/etc/profile中的ulimit -n 65536 ,查看 然后ssh进去,或者退出之后重新登录使之生效 ...
- 009 HDFS的shell命令(里面有一个安全模式)
一:dfs的命令 1.所有的领命 2.解释 -appendToFile <localsrc> ... <dst> :追加文件 -checksum <src> . ...
- git更新到仓库
记录每次更新到仓库 现在我们手上已经有了一个真实项目的 Git 仓库,并从这个仓库中取出了所有文件的工作拷贝.接下来,对这些文件作些修改,在完成了一个阶段的目标之后,提交本次更新到仓库. 请记住,工作 ...
- C++雾中风景7:闭包
本来说好要聊一聊命名空间的,因为最近在看C++lambda表达式的内容,所以借这个机会我们来好好聊一聊C++的闭包. 1.什么是闭包? 闭包(closure)是函数式编程的重要的语法结构. 闭包的概念 ...
- Sting.format字符串格式化
控制格式scanf printf 也不知道为什么=-= 越研究深层的java就越感觉它是从别的语言那抄袭来的
- android 视频 2017
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha