Skip to content

Commit 956157f

Browse files
authored
Merge pull request #188 from jcmartinac/Fix_#185
Fixed and improved navigation bar layout #185
2 parents 828115c + 6a22972 commit 956157f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.8.11
2+
* Fixed navigation bar layout when present passcode with logout enabled in iOS11.
3+
14
# 3.8.10
25
* Added new method to reset passcode `- (void)resetPasscode`, useful when using app extensions.
36

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,15 @@ - (void)_dismissMe {
618618
#pragma mark - UI setup
619619
- (void)_setupNavBarWithLogoutTitle:(NSString *)logoutTitle {
620620
// Navigation Bar with custom UI
621+
UIView *patchView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, LTHMainWindow.frame.size.width, [LTHPasscodeViewController getStatusBarHeight])];
622+
patchView.backgroundColor = [UIColor whiteColor];
623+
patchView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
624+
[self.view addSubview:patchView];
625+
621626
self.navBar =
622-
[[UINavigationBar alloc] initWithFrame:CGRectMake(0, LTHMainWindow.frame.origin.y,
623-
LTHMainWindow.frame.size.width, 64)];
627+
[[UINavigationBar alloc] initWithFrame:CGRectMake(0, patchView.frame.size.height,
628+
LTHMainWindow.frame.size.width, 44)];
629+
self.navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
624630
self.navBar.tintColor = self.navigationTintColor;
625631
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
626632
self.navBar.barTintColor = self.navigationBarTintColor;
@@ -645,7 +651,7 @@ - (void)_setupNavBarWithLogoutTitle:(NSString *)logoutTitle {
645651
item.hidesBackButton = YES;
646652

647653
[self.navBar pushNavigationItem:item animated:NO];
648-
[LTHMainWindow addSubview:self.navBar];
654+
[self.view addSubview:self.navBar];
649655
}
650656

651657
- (void)_setupViews {

0 commit comments

Comments
 (0)