【问题标题】:Which layout would be the most appropriate in this case? Xamarin forms在这种情况下,哪种布局最合适? Xamarin 形式
【发布时间】:2019-08-01 19:23:12
【问题描述】:

我有以下问题,我在右侧创建了一对圆形按钮和标题标签,我在水平方向的 StackLayout 上尝试了它,如下所示:

<StackLayout
     x:Name="ButtonsLayout"
     Orientation="Horizontal"
     Grid.Column="0"
     Grid.ColumnSpan="5"
     Grid.Row="0"
     Grid.RowSpan="1">                    
 </StackLayout>

那么,问题来了:

如果标题不是巧合,结果与我的目标相似:

如果按钮右侧显示的标题太大而无法仅在一行中显示,我想在下面创建一对按钮和标题,我尝试垂直方向但将它们全部垂直放置,我想要这样的东西:

按钮和标题对由代码添加。

【问题讨论】:

  • 您尝试过哪些其他布局,为什么不适合您?

标签: xaml layout xamarin.forms responsive-design


【解决方案1】:

查看FlexLayout。您可以为希望控件流动的方式指定许多规范。如果您想要绑定项目源到您的布局,您可以使用BindableLayout 附加属性将集合绑定到 FlexLayout。

FlexLayout Documentation

BindableLayout Documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-06
    • 1970-01-01
    • 2023-03-10
    • 2012-10-29
    • 1970-01-01
    • 1970-01-01
    • 2011-06-30
    相关资源
    最近更新 更多