9
任何人都可以告诉我如何在XAML中设置TableView。试过 -Xamarin在XAML中构建TableView
<?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="XYZ.Forms.HardCodedCells">
<ContentPage.Content>
<StackLayout>
<Label Text="Above TableView"></Label>
<TableView>
<TableRoot>
<TableSection Title="Test">
<TextCell Text="Test"></TextCell>
</TableSection>
</TableRoot>
</TableView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
这个“尝试”在屏幕上呈现空白?
如果我增加额外的电池,说的EntryCell,到TableSection我得到 -
“对象类型Xamarin.Forms.TextCell无法转换为目标类型:Xamarin.Forms.View”
另外,我可以在哪里看到每个Forms元素的有效XAML语法?
@StephaneDelcroix和海报:所以我很困惑正确的XAML使用时,我只是想与一些部分的“TableView”。我应该做''或者我不需要''部分,还是我不需要''部分? –
hvaughan3
hi @ hvaughan3 - 我还没有重新访问过Xamarin Forms,因为当我写这篇文章的时候很早V1 - 也许现在请查阅这些“更新”的文档 - http://developer.xamarin.com/guides/cross-platform/xamarin-形式/用户界面/的tableview / – WickedW