如何设置ListViewItem被选中时的颜色? 50
在C#里,ListViewItem被选中时默认为深蓝色。我觉得这颜色太难看,想改成浅蓝色,请问该如何实现?附上ListView部分的XAML代码:<ListViewIte...
在C#里,ListViewItem被选中时默认为深蓝色。我觉得这颜色太难看,想改成浅蓝色,请问该如何实现?
附上ListView部分的XAML代码:
<ListView
ItemsSource="{Binding Source={StaticResource
myDateCollectionDataSource}}"
HorizontalAlignment="Center"
Background="#FFDAE7F7"
Height=" 228"
SelectionChanged="SelectMeeting">
<ListView.View>
<GridView >
<GridViewColumn Header="名称" Width="254 "
HeaderContainerStyle="{StaticResource myHeaderStyle}"
HeaderTemplate="{StaticResource myHeaderTemplate}"
CellTemplate="{StaticResource myCellTemplateName}"
/>
<GridViewColumn Header="时间" Width="127"
HeaderContainerStyle="{StaticResource myHeaderStyle}"
HeaderTemplate="{StaticResource myHeaderTemplate}"
CellTemplate="{StaticResource myCellTemplateDate}"/>
</GridView>
</ListView.View>
</ListView>
其中用到了数据绑定,那些Item都是绑定到源的。 展开
附上ListView部分的XAML代码:
<ListView
ItemsSource="{Binding Source={StaticResource
myDateCollectionDataSource}}"
HorizontalAlignment="Center"
Background="#FFDAE7F7"
Height=" 228"
SelectionChanged="SelectMeeting">
<ListView.View>
<GridView >
<GridViewColumn Header="名称" Width="254 "
HeaderContainerStyle="{StaticResource myHeaderStyle}"
HeaderTemplate="{StaticResource myHeaderTemplate}"
CellTemplate="{StaticResource myCellTemplateName}"
/>
<GridViewColumn Header="时间" Width="127"
HeaderContainerStyle="{StaticResource myHeaderStyle}"
HeaderTemplate="{StaticResource myHeaderTemplate}"
CellTemplate="{StaticResource myCellTemplateDate}"/>
</GridView>
</ListView.View>
</ListView>
其中用到了数据绑定,那些Item都是绑定到源的。 展开
2个回答
展开全部
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@drawable/listitem_normal" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/listitem_highlight" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/listitem_highlight" />
<item android:state_selected="true" android:drawable="@drawable/listitem_normal" />
<item android:state_focused="true" android:drawable="@drawable/listitem_normal" />
</selector>
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@drawable/listitem_normal" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/listitem_highlight" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/listitem_highlight" />
<item android:state_selected="true" android:drawable="@drawable/listitem_normal" />
<item android:state_focused="true" android:drawable="@drawable/listitem_normal" />
</selector>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询