【发布时间】:2016-05-24 03:12:09
【问题描述】:
我在 xaml 文件中的ListView 结构写在下面。在这个列表视图中,我添加了一些列表项。当我单击此项目中的任何项目时,所选项目的背景颜色默认为橙色。我希望这个选定的 iem 的背景是黑色的。如何在 xaml 中实现这一点?
<ListView x:Name="LstMenu"
HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Vertical"`enter code here`
Padding="10">
<Label Text="{Binding ListItems}"
FontSize="15"
TextColor="White"
HorizontalTextAlignment="Start"
VerticalTextAlignment="Center" />
</StackLayout>
<Grid BackgroundColor="Black"
HeightRequest="1"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
【问题讨论】:
标签: xaml xamarin.forms