【问题标题】:Flyout in Xamarin FormsXamarin 表单中的弹出窗口
【发布时间】:2020-03-21 21:35:48
【问题描述】:

我正在尝试在 Xamarin 表单中实现 Flyout。我得到的所有参考资料都是 shell.Flyout,但没有一个符合我的要求。

我在 ListView 中显示一些数据,并在单击任何特定项目时,我希望 Flyout 打开,如模型中所示。

请建议 Xamarin 中的任何支持库或控件。

【问题讨论】:

标签: xamarin xamarin.forms xamarin.android xamarin.ios xamarin-studio


【解决方案1】:

您可以尝试为每个项目添加它,然后控制 IsVisible 属性

Listview 项目模板中的类似内容

    <FlexLayout Direction="Row" HorizontalOptions="CenterAndExpand">
         <StackLayout FlexLayout.Basis="40%">
               <Label Text="Item"
                      HorizontalTextAlignment="Center"/>
         </StackLayout>
         <StackLayout FlexLayout.Grow="1" Padding="5">
               <Frame IsVisible="True">
                     <!--Your Flyout here-->
               </Frame>
         </StackLayout>
    </FlexLayout>

但这意味着你必须自己在后台代码中管理它们

单击列表中的项目时更改 Flyout 上的 IsVisible 属性

【讨论】:

  • 其实主页面有两个容器。白色部分是一个容器上的视图,而列表视图部分在另一个容器中
  • 然后您可以在运行时以编程方式将其添加到正确的容器中。问题是这样做会有点困难,因为您必须正确定位它。它本质上是 2 个列表,您必须自己管理其中显示的项目。
猜你喜欢
  • 1970-01-01
  • 2017-11-26
  • 2017-01-31
  • 1970-01-01
  • 2019-07-16
  • 1970-01-01
  • 2022-01-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多