在xmlns =“ http://xamarin.com/schemas/2014/forms”中找不到类型SwipeGestureReconizer。

时间:2019-06-03 08:26:05

标签: xamarin.forms

我正在尝试设置侧面菜单以导航到其他页面。但是我的SwipeReonizer似乎不起作用

我从docs(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";
   }

0 个答案:

没有答案