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

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.