2
這裏是我與現在使用的代碼...Xamarin窗體ListView不顯示TextCells
items = new List<TextCell>();
items.Add(new TextCell { Text = "Cake", TextColor = Color.Green, Detail = "12 hours left!", DetailColor = Color.Black});
items.Add(new TextCell { Text = "Pie", TextColor = Color.Green, Detail = "14 hours left!", DetailColor = Color.Black });
var buy = new ContentPage
{
Title = "Buy",
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new ListView
{
ItemsSource = items,
ItemTemplate = new DataTemplate(typeof(TextCell))
}
}
}
};
ListView控件填充了沒有內容兩個空的觀點。
我是否缺少一些房產?