【发布时间】:2017-03-27 20:42:06
【问题描述】:
您在下面看到的是主页,稍后我会在其中包含其他视图。 我想制作一个从左侧滑动并打开到屏幕三分之二的菜单。 我来自 WPF 编程,在这里,我注意到有 z-index。 我搜索了网络,但找不到很好的结果。 任何人都可以向我推荐一个重叠网格的解决方案,以便能够使菜单及其菜单项的需求可见。
<?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="Fimap.WebPart.MainWeb">
<ContentPage.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="9*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0" BackgroundColor="#0084CA">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.3*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Image Aspect="AspectFit" x:Name="menuImageButton" Grid.Column="0" Grid.Row="0" Source="Images/menu.png"></Image>
</Grid>
<Grid Grid.Row="1" BackgroundColor="#fff">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<ScrollView>
<StackLayout VerticalOptions="FillAndExpand" x:Name="downContent" HorizontalOptions="FillAndExpand" Orientation="Vertical" Spacing="15">
<!--RELOAD VIEW HERE-->
</StackLayout>
</ScrollView>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
【问题讨论】:
-
如果您需要左侧的滑动菜单,您是否尝试过
MasterDetailPage?
标签: c# xaml xamarin.forms cross-platform portable-class-library