Shimmer Glow Animation Effect

Source: Internet
Author: User

Shimmer Glow Animation Effect

Effect

Source

Https://github.com/facebook/Shimmer

Https://github.com/YouXianMing/Animations

////SHIMMERCONTROLLER.M//Animations////Created by youxianming on 15/12/18.//copyright©2015 year youxianming. All rights reserved.//#import "ShimmerController.h"#import "uiview+setrect.h"#import "FBShimmeringLayer.h"#import "FBShimmeringView.h"#import "StrokeCircleLayerConfigure.h"@interfaceShimmercontroller ()@end@implementationShimmercontroller- (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"Size60.0]; Logolabel.textcolor=[Uicolor Whitecolor]; Logolabel.textalignment=Nstextalignmentcenter; Logolabel.backgroundcolor=[Uicolor Clearcolor]; Shimmeringview.contentview=Logolabel; } {Fbshimmeringlayer*shimmeringlayer =[Fbshimmeringlayer layer]; Shimmeringlayer.frame= (CGRect) {Cgpointzero, Cgsizemake (( the+1) *2, ( the+1) *2)}; 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 = [StrokecirclelayerconfigureNew]; Config.linewidth=1. F; Config.startangle=0; Config.endangle= M_pi *2; Config.radius= the. F; Config.strokecolor=[Uicolor Redcolor];                [Config Configcashapelayer:circleshape]; Shimmeringlayer.contentlayer=CircleShape; }}- (void) Buildtitleview {[Super Buildtitleview]; //Title label.UILabel *headlinelabel = [UILabelNew]; 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 (0,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 (0,0, -, -)]; 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

Details

Shimmer Glow Animation Effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.