xamarin.forms – 如何在Plugin.Fingerprint对话中隐藏USE FALLBACK

我在我的xamarin应用程序中使用Plugin.Fingerprint Plugin实现了手指触摸登录.

我不想在对话中显示USE FALLBACK选项.

我试过这种方式来隐藏它

 var config = new AuthenticationRequestConfiguration("pput your finger to authenticate!")
                {
                    FallbackTitle = string.Empty
                };

                var auth = await CrossFingerprint.Current.AuthenticateAsync(config);

但它仍然显示出来.

任何人都知道我怎么能隐藏它?

请帮忙 .

最佳答案 在android平台上,如果要禁用它,可以从FingerprintDialogFragment继承并覆盖OnCreateView.

    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    var view = base.OnCreateView(inflater, container, savedInstanceState);
    view.FindViewById<Button>(Resource.Id.fingerprint_btnFallback).Visibility = ViewStates.Gone;
    return view;
}

在MainApplication类中,重写OnCreate

public override void OnCreate()
        {
            base.OnCreate();
            RegisterActivityLifecycleCallbacks(this);
            //A great place to initialize Xamarin.Insights and Dependency Services!

            CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);

            CrossFingerprint.SetDialogFragmentType<MyCustomDialogFragment>();
        }
点赞