如何在Xamarin.Forms中使用TableView?

时间:2018-12-10 11:05:47

标签: xaml xamarin xamarin.forms

我对Xamarin.Forms相对陌生,对Xamarin TableView有疑问。

我想创建一个类似于以下所示的布局。

Desired Layout with Xamarin TableView

问题是,我可以为此使用TableView还是有其他选择?谁能用XAML代码显示此内容?

谢谢。

编辑:不需要底部的标签。

1 个答案:

答案 0 :(得分:2)

我不是无礼的意思,但这很容易从documentation pages中检索出来,并且需要尝试一下。

要开始使用,请尝试以下操作:

<TableView Intent="Settings">
    <TableView.Root>
        <TableView.Section>
            <ImageCell Text="Invoice Customization" Source="Invoice_image.png" />
            <ImageCell Text="Invoice Defaults" Source="Invoice_image.png" />
        </TableView.Section>
        <TableView.Section Title="Security">
            <SwitchCell Text="Use Touch ID" />
        </TableView.Section>
        ... etc.
   </TableView.Root>
</TableView>

Xamarin无法使用单元格末尾的箭头和“安全性”部分下方的页脚文本。开箱即用的表单可能会要求您编写自定义渲染器。

相关问题