Xamarin拖放标签

时间:2019-12-11 19:26:54

标签: c# xamarin xamarin.forms xamarin.android xamarin.ios

我有问题。我正在跟随某人的这段代码:https://github.com/CrossGeeks/DragViewSample/tree/master/DragViewSample/DragViewSample拖放标签,所以我使用了xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Memento.DraggableView"
             x:Class="MyApp.TestPage">
    <AbsoluteLayout>
        <StackLayout AbsoluteLayout.LayoutFlags="All" x:Name="dragLayout"
                          AbsoluteLayout.LayoutBounds="0,0,1,1" IsVisible="true"
                          VerticalOptions="FillAndExpand"  HorizontalOptions="FillAndExpand">
            <local:DraggableView x:Name="dragView"  VerticalOptions="CenterAndExpand"
                          DragMode="Touch" DragDirection="All" >
                <local:DraggableView.Content>
                    <Label Text="Test Label" TextColor="Black" />
                </local:DraggableView.Content>
            </local:DraggableView>
        </StackLayout>
    </AbsoluteLayout>
</ContentPage>

但是当我尝试移动标签时,什么也没发生!? 我没有在后台添加任何C#代码,因为我认为这不是必需的。在他的示例中,他仅将c#用于列表视图,但我将其删除了,所以...

我在做什么错了?

0 个答案:

没有答案