【发布时间】:2018-02-27 04:41:09
【问题描述】:
我不知道我的代码是否显示FOOS 列表。它确实生成了一个可点击的列表项,该列表项转到正确的详细信息页面,问题是列表项为空白或所有文本均为白色.我不知道是哪个。
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MaopApplication.Views.PipelineSearch">
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Horizontal" >
<Entry Placeholder="Search With PipelineName" Text="{Binding SearchText}" ></Entry>
<Button Text="Search" Command="{Binding SearchPipes}" />
</StackLayout>
<ListView ItemsSource="{Binding Foos}" ItemTapped="OnListViewItemTapped" ItemSelected="OnListViewItemSelected">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View BackgroundColor="Red">
<StackLayout>
<label Text="wtf" TextColor="Black"></label>
<label Text="{Binding Test}"TextColor="Black"/>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
创建 FOOS 的代码
var Foos = new List<object>() {new {Test = "foo"}, new {Test = "bar"}};
【问题讨论】:
-
很奇怪。您是否在“输出”窗口中看到任何错误消息?你能把你用来填写
Foos的代码贴出来吗? -
无错误。完全没有
-
你可以试试 listview: VerticalOptions="FillAndExpand"
-
调试 Xamarin Forms 时要尝试的随机操作...重新启动设备/模拟器,重置设备/模拟器,重新启动 Visual Studio,重新启动计算机...... '没有在增量构建中获取,要么从设备中删除应用程序并清理解决方案......
标签: xaml xamarin xamarin.forms