Xamarin.Forms ListView 自定义选中行颜色

只需在Resources\Value下编辑Style.xml文件即可:

 1 <resources>
 2   <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
 3    <item name="android:colorPressedHighlight">@color/ListViewSelected</item>
 4    <item name="android:colorLongPressedHighlight">@color/ListViewHighlighted</item>
 5    <item name="android:colorFocusedHighlight">@color/ListViewSelected</item>
 6    <item name="android:colorActivatedHighlight">@color/ListViewSelected</item>
 7    <item name="android:activatedBackgroundIndicator">@color/ListViewSelected</item>
 8   </style>
 9 <color name="ListViewSelected">#FFF933</color>
10 <color name="ListViewHighlighted">#FFF933</color>
11 </resources>

 

posted @ 2022-06-27 14:38  心如大海  阅读(213)  评论(0编辑  收藏  举报