From e2587fc6d5ab2ff234584dfe10f258aea213783e Mon Sep 17 00:00:00 2001 From: Simon Maddox Date: Tue, 8 Feb 2011 14:18:24 +0000 Subject: [PATCH] Fixed issue where Activity Indicator wouldnt have the correct orientation if the app was launched in Landscape, and orientation wasnt changed until showing the indicator --- Classes/ShareKit/UI/SHKActivityIndicator.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Classes/ShareKit/UI/SHKActivityIndicator.m b/Classes/ShareKit/UI/SHKActivityIndicator.m index 3354f238..8b5483a8 100644 --- a/Classes/ShareKit/UI/SHKActivityIndicator.m +++ b/Classes/ShareKit/UI/SHKActivityIndicator.m @@ -252,7 +252,7 @@ - (void)setProperRotation - (void)setProperRotation:(BOOL)animated { - UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (animated) { @@ -260,16 +260,16 @@ - (void)setProperRotation:(BOOL)animated [UIView setAnimationDuration:0.3]; } - if (orientation == UIDeviceOrientationPortraitUpsideDown) + if (orientation == UIInterfaceOrientationPortraitUpsideDown) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(180)); - - else if (orientation == UIDeviceOrientationPortrait) + + else if (orientation == UIInterfaceOrientationPortrait) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(0)); - else if (orientation == UIDeviceOrientationLandscapeLeft) + else if (orientation == UIInterfaceOrientationLandscapeRight) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(90)); - else if (orientation == UIDeviceOrientationLandscapeRight) + else if (orientation == UIInterfaceOrientationLandscapeLeft) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(-90)); if (animated) @@ -277,4 +277,5 @@ - (void)setProperRotation:(BOOL)animated } + @end