[英]How to fix labels not showing up in ListViews?
我的问题是,当我在标签列表中添加标签时,标签将不会显示。 我将标签绑定到“ DummyClass”内的对象。 名字,姓氏,RepId。
我对此问题进行了大量研究,并请多个人提供有关此主题的帮助,但是似乎没有任何enter image description here
工作。
<StackLayout>
<ListView x:Name="listView"
HeightRequest="100">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Label Text="Hello"
BackgroundColor="Red"
VerticalOptions="FillAndExpand"/>
<Label Text="Yes"
BackgroundColor="Red"
VerticalOptions="FillAndExpand"/>
<Label Text="Wooohooo"
BackgroundColor="Red"
VerticalOptions="FillAndExpand"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
我发现了我的问题所在。 这是ItemSource。 我的ItemSource定义不正确。 解决了我遇到的所有问题。 谢谢大家的帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.