From 1ca1cc1f80a89713551533bb3ad48fc2c49a7842 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 3 Oct 2013 09:05:17 +0200 Subject: [PATCH] Fix messy transitions for iOS7 --- Classes/LinphoneUI/UILinphone.h | 3 ++- Classes/SettingsViewController.m | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneUI/UILinphone.h b/Classes/LinphoneUI/UILinphone.h index d291ff639..68a23f41d 100644 --- a/Classes/LinphoneUI/UILinphone.h +++ b/Classes/LinphoneUI/UILinphone.h @@ -19,7 +19,8 @@ #import -#define LINPHONE_MAIN_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f] +#define LINPHONE_MAIN_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f] +#define LINPHONE_SETTINGS_BG_IOS7 [UIColor colorWithWhite:0.88 alpha:1.0] #define LINPHONE_TABLE_CELL_BACKGROUND_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f] @interface UIColor (LightAndDark) diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index d0eb48067..8469cda3f 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -335,7 +335,12 @@ } + (void)removeBackground:(UIView*)view { - [view setBackgroundColor:[UIColor clearColor]]; + // iOS7 transparent background is *really* transparent: with an alpha != 0 + // it messes up the transitions. Use non-transparent BG for iOS7 + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) + [view setBackgroundColor:LINPHONE_SETTINGS_BG_IOS7]; + else + [view setBackgroundColor:[UIColor clearColor]]; } - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {