首页 > 解决方案 > 在 xmlns="http://xamarin.com/schemas/2014/forms" 中找不到类型 SwipeGestureReconizer

问题描述

我正在尝试设置一个侧面菜单来导航到不同的页面。但我的 SwipeReonizer 似乎不起作用

我从文档中复制了代码(https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/swipe)。

XAML:

<AbsoluteLayout.GestureRecognizers>
      <SwipeGestureRecognizer Direction="Right" Swiped="SwipeGestureRecognizer_Swiped"/>
</AbsoluteLayout.GestureRecognizers>


<Label x:Name="Username"
    AbsoluteLayout.LayoutBounds="180, 20, 200, 100"
    Text="Sint Gordon" TextColor="White" FontSize="Large"
    FontFamily="Proxima Nova bold">
</Label>

C# :

SwipeGestureRecognizer swipeRecon = new SwipeGestureRecognizer();


private void SwipeGestureRecognizer_Swiped(object sender, SwipedEventArgs e)
   {
     Username.Text = "You swiped right";
   }

标签: xamarin.forms

解决方案


推荐阅读