Status Bar animation switching effect, status bar animation Switching

Source: Internet
Author: User

Status Bar animation switching effect, status bar animation Switching

Status Bar animation Switching Effect

 

Effect

 

Source code

StatusBarAnimation in https://github.com/YouXianMing/iOS-Project-Examples

/// StatusBarValue. h // StatusBarAnimation // Created by YouXianMing on 16/7/18. // Copyright©2016 YouXianMing. all rights reserved. // # import <Foundation/Foundation. h> # import <UIKit/UIKit. h> @ interface StatusBarValue: NSObject @ property (nonatomic, weak) UIViewController * controller;/*** Default value is UIStatusBarAnimationFade. */@ property (nonatomic) UIStatusBarAnimation animationType;/*** Default value is UIStatusBarStyleDefault. */@ property (nonatomic) UIStatusBarStyle style;/*** Default value is NO. */@ property (nonatomic) BOOL hidden;/*** SetNeedsStatusBarAppearanceUpdate ** @ param animated Animated or not. * @ param duration Animation's duration. */-(void) initialize :( BOOL) animated duration :( NSTimeInterval) duration; # pragma mark-Constructor + (instancetype) statusBarValueWithController :( UIViewController *) controller; @ end
/// StatusBarValue. m // StatusBarAnimation // Created by YouXianMing on 16/7/18. // Copyright©2016 YouXianMing. all rights reserved. // # import "StatusBarValue. h "@ implementation StatusBarValue-(instancetype) init {if (self = [super init]) {self. animationType = UIStatusBarAnimationFade; self. style = UIStatusBarStyleDefault; self. hidden = NO;} return self;}-(void) statusBarAppearanceUpdateAnimated :( BOOL) animated duration :( NSTimeInterval) duration {if (self. controller) {if (animated) {[UIV Iew animateWithDuration: duration> 0? Duration: 0.35f animations: ^ {[self. controller setNeedsStatusBarAppearanceUpdate];} else {[self. controller setNeedsStatusBarAppearanceUpdate] ;}}+ (instancetype) statusBarValueWithController :( UIViewController *) controller {StatusBarValue * value = [[[self class] alloc] init]; value. controller = controller; return value;} @ end

 

Related Article

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.