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辉光动画效果的更多相关文章

  1. 使用CALayer制作View的辉光效果

    使用CALayer制作View的辉光效果 实现以下的辉光效果: 思路是这样子的: 1. 创建好需要实现辉光效果的View 2. 对这个View进行截图 3. 将这个截图重新添加进View中 4. 对这 ...

  2. iOS之UI--辉光动画

    前言:学习来自YouXianMing老师的博客:<辉光UIView的category>以及YouXianMing老师的github源码:< GlowView >    而我个人 ...

  3. jquery添加光棒效果的各种方式以及简单动画复杂动画

    过滤器.绑定事件.动画   一.基本过滤器 语法 描述 返回值 :first 选取第一个元素 单个元素 :last 选取最后一个元素 单个元素 :not(selector) 选取去除所有与给定选择器匹 ...

  4. 支持辉光效果的Label

    支持辉光效果的Label 效果 源码 https://github.com/YouXianMing/UI-Component-Collection 中的 FBGlowLabel // // FBGlo ...

  5. GraphicsLab Project之辉光(Glare,Glow)效果 【转】

    作者:i_dovelemon 日期:2016 / 07 / 02 来源:CSDN 主题:Render to Texture, Post process, Glare, Glow, Multi-pass ...

  6. 辉光UIView的category

    辉光UIView的category 本人视频教程系类   iOS中CALayer的使用 效果如下: 源码: UIView+GlowView.h 与 UIView+GlowView.m // // UI ...

  7. iOS酷炫动画效果合集

    iOS酷炫动画效果合集 源码地址 https://github.com/YouXianMing/Animations 效果绝对酷炫,包含了多种多样的动画类型,如POP.Easing.粒子效果等等,虽然 ...

  8. 辉光的UIView

    辉光的UIView 辉光UIView使用了一个UIView的一个category,名为UIView+Glow,请自行到github上查找. 源码如下: // // RootViewController ...

  9. Android Shimmer 发光微光动画

    这是Facebook提供的一个类库(题外话http://code.facebook.com,这里有很多好玩有趣有用的Facebook开源的类库) 这么炫酷的发光动画效果,想必很多Android码农都会 ...

随机推荐

  1. Aspose.Words 自定义文档模版生成操作类

    /// <summary> /// 操作word通用类 LIYOUMING add 2017-12-27 /// </summary> public class DocHelp ...

  2. JSP的学习三(中文乱码)

    1). 在 JSP 页面上输入中文, 请求页面后不出现乱码: 保证 contentType="text/html; charset=UTF-8", pageEncoding=&qu ...

  3. 使用 Web 服务 为 ECS Linux 实例配置网站及绑定域名

    Nginx 服务绑定域名 https://help.aliyun.com/knowledge_detail/41091.html?spm=a2c4e.11155515.0.0.4lvCpF 以 YUM ...

  4. Python爬虫个人记录(二) 获取fishc 课件下载链接

    参考: Python爬虫个人记录(一)豆瓣250 (2017.9.6更新,通过cookie模拟登陆方法,已成功实现下载文件功能!!) 一.目的分析 获取http://bbs.fishc.com/for ...

  5. springboot+thymeleaf 模板中传递参数误报错误 红色波浪线

    在使用IDEA开发SpringBoot项目时,使用了Thymeleaf模板引擎,在使用动态传参数时,HTML页面的动态参数出现了红色波浪线,情况如下如: 解决办法: 选择 File -> Set ...

  6. 1032 Sharing (25)(25 point(s))

    problem To store English words, one method is to use linked lists and store a word letter by letter. ...

  7. Ubuntu18.04 创建桌面快捷方式

    一.基本概念 Linux 系统中的Desktop Entry 文件以desktop为后缀名.Desktop Entry 文件是 Linux 桌面系统中用于描述程序启动配置信息的文件.  进入/usr/ ...

  8. Codeforces.547C.Mike and Foam(容斥/莫比乌斯反演)

    题目链接 \(Description\) 给定n个数(\(1\leq a_i\leq 5*10^5\)),每次从这n个数中选一个,如果当前集合中没有就加入集合,有就从集合中删去.每次操作后输出集合中互 ...

  9. 【set】【multiset】Codeforces Round #484 (Div. 2) D. Shark

    题意:给你一个序列,让你找一个k,倘若把大于等于k的元素都标记为不可用,那么剩下的所有元素形成的段的长度相同,并且使得段的数量尽量大.如果有多解,输出k尽量小的. 把元素从大到小排序插回原位置,用一个 ...

  10. bzoj 2850

    比较基础的KD树.每个节点维护一个BOX,包含包含当当前子树的点的最小矩形,以及点权和,然后用“整个矩形都在直线的一侧”和“整个矩形都不在直线的一侧”剪枝. /******************** ...