如何从Touch ID警报视图中删除"输入密码"和"取消"按钮

Rah*_*pta 21 uialertview ios lacontext

我卡住了,不想在Thumb of thumb impression中输入密码

[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:NSLocalizedString(@"UNLOCK_ACCESS_TO_LOCKED_FEATURE", nil) reply:
         ^(BOOL success, NSError *authenticationError)
         {
             if (success)
             {

                 msg =[NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_SUCCESS", nil)];
             }
             else
             {
                 msg = [NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_WITH_ERROR", nil), authenticationError.localizedDescription];
             }
         }];
     }
Run Code Online (Sandbox Code Playgroud)

you*_*man 61

要隐藏"输入密码"按钮,您需要设置localizedFallbackTitle为空字符串.

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

// Hide "Enter Password" button
context.localizedFallbackTitle = @"";

// show the authentication UI
//...
Run Code Online (Sandbox Code Playgroud)

关于"取消"按钮我不认为可以删除它.

希望它会有所帮助.


Jay*_*bey 9

LAContext类有localizedFallbackTitle属性.如果您想要自定义文本而不是"输入密码",则可以在此处进行设置.

如果将其设置为空字符串,则该按钮将被隐藏.

截图1

以下是我用过的代码:

 //MARK: - scanFingerPrint
    func scanFingerPrint() {
        let authContext:LAContext = LAContext()
        authContext.localizedFallbackTitle = ""
    . . .
    }
Run Code Online (Sandbox Code Playgroud)

截图2