【问题标题】:Create menus that slide from left Xamarin forms pcl创建从左侧 Xamarin 表单 pcl 滑动的菜单
【发布时间】: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


【解决方案1】:

根据您的需要,您可以查看 skar 建议的主详细信息页面,或者另一种选择是查看此插件:

这个插件并不总是免费的,但现在它是。

我目前同时使用左侧导航菜单(主从菜单)和右侧过滤菜单(幻灯片套件)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-26
    • 2016-11-27
    • 2013-10-03
    • 1970-01-01
    • 2017-09-28
    • 2013-02-01
    • 1970-01-01
    • 2013-06-19
    相关资源
    最近更新 更多