From 4d746b830fac1e4cd776e80879e4baa506af8631 Mon Sep 17 00:00:00 2001 From: Martin Gratzer Date: Mon, 18 Aug 2014 08:58:26 +0200 Subject: [PATCH] Fixes issue rolandleth/LTHPasscodeViewController#72 [[UIApplication sharedApplication] statusBarFrame].size.height returns 1024 in lanscape (iOS7.1). This caused the passcode view to be off screen. I didn't test this change on iOS6. --- LTHPasscodeViewController/LTHPasscodeViewController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LTHPasscodeViewController/LTHPasscodeViewController.m b/LTHPasscodeViewController/LTHPasscodeViewController.m index 67fc148..4746bf8 100644 --- a/LTHPasscodeViewController/LTHPasscodeViewController.m +++ b/LTHPasscodeViewController/LTHPasscodeViewController.m @@ -760,8 +760,10 @@ - (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout an newCenter = CGPointMake(mainWindow.center.x, mainWindow.center.y + self.navigationController.navigationBar.frame.size.height / 2); } - if (![UIApplication sharedApplication].statusBarHidden) { - newCenter.y += [[UIApplication sharedApplication] statusBarFrame].size.height; + + if (![[UIApplication sharedApplication] isStatusBarHidden]) { + newCenter.y += MIN([[UIApplication sharedApplication] statusBarFrame].size.height, + [[UIApplication sharedApplication] statusBarFrame].size.width); } if (animated) {