2016-12-21 36 views
0

使用触摸ID对用户进行身份验证时,弹出窗口将出现在窗口中,但键盘视图已从窗口中部分消失(附件视图不会用键盘消除)。我添加了一个屏幕截图,供大家参考触摸ID默认警报部分隐藏屏幕上的键盘

enter image description here

事实上,我们预期的结果,这样的one

enter image description here

我叫下面的代码从viewDidLoad中功能的用户进行身份验证。如果我们在验证状态之前点击文本字段。问题将会发生。

LAContext *context = [[LAContext alloc] init]; 

context.localizedFallbackTitle = @""; 

NSError *error = nil; 
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { 

    // If pass coed set means this loop 
    [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@“Login With your Touch ID” reply:^(BOOL success, NSError *error) { 

     if (error) { 
     dispatch_async(dispatch_get_main_queue(), ^{ 
     // show error message 
     }); 

     return; 
     } 

    if (success) { 
     // allow user to a/c section 
    } else { 
     // Will add wrong user message 
    } 

    }]; 

请帮我们解决这个问题。谢谢!

+0

请提供一些代码snippet –

+0

@MaulikBhuptani - 现在,我已经添加了上面的示例代码供您参考。 – kalai

回答

0

为了防止这种情况,你应该viewDidLoad和触摸ID访问块使用[self.view setUserInteractionEnabled:false];再次

dispatch_async(dispatch_get_main_queue(), ^{ [self.view setUserInteractionEnabled:true]; });

您还需要监控设备是否支持触摸ID访问或不

+0

好的,谢谢:) – kalai