[英]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.