有没有办法在桌面上禁用Xamarin Forms SwipeGestureRecognizer?

我有一个Xamarin Forms应用程序,我想知道是否有可能只允许在电话(或小屏幕)上使用SwipeGestureRecognizer。

我正在使用具有2个内容视图的视图。在台式机上,我想同时在屏幕上看到它们,但是在电话上,我想分别地看到它们(滑动手势)。

        <ContentView.GestureRecognizers>
            <SwipeGestureRecognizer Command="{Binding SwipedViewCommand}" Direction="Right" />
        </ContentView.GestureRecognizers>

该命令将布尔值取反,并且每个内容视图都绑定到该布尔值(一个检查为true,另一个检查为false)

https://docs.microsoft.com/es-es/xamarin/xamarin-forms/app-fundamentals/gestures/swipe

sl819532666 回答:有没有办法在桌面上禁用Xamarin Forms SwipeGestureRecognizer?

XF上有一个问题:https://github.com/xamarin/Xamarin.Forms/issues/8756

同时,您可以将CanExecute中的Command设置为:

new Command(() => { },() => Device.Idiom == TargetIdiom.Phone);

本文链接:https://www.f2er.com/2913977.html

大家都在问