marinofaggiana 4 年之前
父節點
當前提交
b758033322
共有 1 個文件被更改,包括 3 次插入9 次删除
  1. 3 9
      iOSClient/Library/BKPasscodeView/BKPasscodeViewController.m

+ 3 - 9
iOSClient/Library/BKPasscodeView/BKPasscodeViewController.m

@@ -128,9 +128,9 @@ typedef enum : NSUInteger {
     [self lockIfNeeded];
 }
 
-- (void)viewWillAppear:(BOOL)animated
+- (void)viewDidAppear:(BOOL)animated
 {
-    [super viewWillAppear:animated];
+    [super viewDidAppear:animated];
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
         
@@ -153,13 +153,7 @@ typedef enum : NSUInteger {
     [super viewDidLayoutSubviews];
     
     CGRect frame = self.view.bounds;
-    CGFloat topBarOffset = 0;
-    
-    /*
-    if ([self respondsToSelector:@selector(topLayoutGuide)]) {
-        topBarOffset = [self.topLayoutGuide length];
-    }
-    */
+    CGFloat topBarOffset = [UIApplication sharedApplication].delegate.window.safeAreaInsets.top;
     
     frame.origin.y += topBarOffset;
     frame.size.height -= (topBarOffset + self.keyboardHeight);