From 0e49bd4e7cad56399b852cad376fe0809b7f4d03 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 2 Jun 2014 17:04:50 +0200 Subject: [PATCH] Fix the status bar color in a better fashion. --- Classes/PhoneMainView.m | 22 ++++++++-------------- Classes/PhoneMainView.xib | 10 +++++----- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index f7536afae..d360fa9b6 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -472,26 +472,20 @@ static PhoneMainView* phoneMainViewInstance=nil; // In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the // status bar style for each transition to/from these views BOOL toLightStatus = (to_view != NULL) && ![PhoneMainView isDarkBackgroundView:to_view]; - BOOL fromLightStatus = ![PhoneMainView isDarkBackgroundView:currentView]; - if( !toLightStatus ) { // black bg: white text on black background [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; - if(statusBarBG.hidden == YES){ - statusBarBG.alpha = 0; - statusBarBG.hidden = NO; - [UIView animateWithDuration:0.3f - animations:^{statusBarBG.alpha = 1;} ]; - } - } else if(!fromLightStatus && toLightStatus) { + + [UIView animateWithDuration:0.3f + animations:^{statusBarBG.backgroundColor = [UIColor blackColor];} ]; + + } else { // light bg: black text on white bg [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; - if( statusBarBG.hidden == NO ){ - [UIView animateWithDuration:0.3f - animations:^{ statusBarBG.alpha = 0; } - completion:^(BOOL finished) {statusBarBG.hidden = YES;}]; - } + [UIView animateWithDuration:0.3f + animations:^{ statusBarBG.backgroundColor = [UIColor colorWithWhite:0.935 alpha:1]; }]; + } #endif } diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index 0489bf186..7a775401b 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -1,8 +1,8 @@ - + - - + + @@ -22,7 +22,7 @@ - \ No newline at end of file +