Animation 表单-如何使左侧边栏向外滑动并使用它滑动主页面

Animation 表单-如何使左侧边栏向外滑动并使用它滑动主页面,animation,xamarin,xamarin.forms,slidingmenu,Animation,Xamarin,Xamarin.forms,Slidingmenu,我希望创建一个特定的动画,从一个折叠的侧栏(仍然可见,但很瘦)和主页内容开始: 当您拉出左侧边栏时,边栏将展开,主要内容也随之移动(以便主要内容的右侧部分滑出视图): 另外,请注意,侧边栏中的内容不会移动(尽管会出现其他内容(底部的按钮)),而是侧边栏容器的宽度会扩大。最后,我希望它能用我的手指滑动,而不仅仅是一个静态动画 如何在Xamarin.Forms中实现这一点?(可能吗?您可以在Telerik Xamarin表单示例中找到它(SlideDrawer->转换/位置) 登录你的帐户(te

我希望创建一个特定的动画,从一个折叠的侧栏(仍然可见,但很瘦)和主页内容开始:

当您拉出左侧边栏时,边栏将展开,主要内容也随之移动(以便主要内容的右侧部分滑出视图):

另外,请注意,侧边栏中的内容不会移动(尽管会出现其他内容(底部的按钮)),而是侧边栏容器的宽度会扩大。最后,我希望它能用我的手指滑动,而不仅仅是一个静态动画


如何在Xamarin.Forms中实现这一点?(可能吗?

您可以在Telerik Xamarin表单示例中找到它(SlideDrawer->转换/位置)

登录你的帐户(telerik.com),我认为它是免费的


您可以在Telerik Xamarin表单示例中找到它(SlideDrawer->Transitions/Location)

登录你的帐户(telerik.com),我认为它是免费的

使用Xamarin Studio XAML预览版: 将展开事件绑定到第一个“列”中的
WidthRequest
,以调整其大小并将“右侧”推到上方。根据第一列中的控件设置,它们将展开以填充新的“列”宽度或保持固定大小

注意:我个人会使用
ConstraintExpression
s来实现这一点,以使设计真正动态并适应方向变化、不同屏幕大小等。。。
播放Xamarin Studio XAML预览:
将展开事件绑定到第一个“列”中的
WidthRequest
,以调整其大小并将“右侧”推到上方。根据第一列中的控件设置,它们将展开以填充新的“列”宽度或保持固定大小

注意:我个人会使用
ConstraintExpression
s来实现这一点,以使设计真正动态并适应方向变化、不同屏幕大小等。。。
是否有可能让幻灯片与手指配合,而不是静态动画?当然,您可以附加触摸手势并执行滑动或触摸/拖动等操作。。。i、 e.在选择的触摸事件中,您可以更改“左面板”的请求宽度,并使其跟踪您的手指。。。有没有可能让幻灯片与手指配合,而不是静态动画?当然,您可以附加触摸手势并进行滑动或触摸/拖动等操作。。。i、 e.在选择的触摸事件中,您可以更改“左面板”的请求宽度,并使其跟踪您的手指。。。你能按你描述的那样做UI吗?你能按你描述的那样做UI吗?
<StackLayout RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.25}"
                   RelativeLayout.YConstraint= "{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.75}"
</StackLayout>
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="OpenDrawer.TestLayoutPreview">
    <ContentPage.Content>
        <StackLayout BackgroundColor="Blue" Orientation="Horizontal">
            <StackLayout Orientation="Vertical">
                <StackLayout Orientation="Vertical" BackgroundColor="Maroon" HorizontalOptions="Start" VerticalOptions="FillAndExpand" MinimumWidthRequest="100" WidthRequest="100">
                    <Button Text="Left 1" BackgroundColor="Aqua"></Button>
                    <Button Text="Left 2" BackgroundColor="Aqua"></Button>
                    <Button Text="Left 3" BackgroundColor="Aqua"></Button>
                </StackLayout>
                <StackLayout Orientation="Vertical" VerticalOptions="End">
                    <Button Text="Left Bottom" BackgroundColor="Lime"></Button>
                </StackLayout>
            </StackLayout>
            <StackLayout Orientation="Vertical" BackgroundColor="Red" HorizontalOptions="FillAndExpand">
                <Label Text="Right" BackgroundColor="Aqua"></Label>
                <ScrollView>
                    <WebView Source="https://xamarin.com" WidthRequest="1000" HeightRequest="1000" ></WebView>
                </ScrollView>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>