简体   繁体   English

在Xamarin.Forms Android中设置选定的ListView TextColor

[英]Set selected ListView TextColor in Xamarin.Forms Android

I want to set the selected Text Color of a ListViewItem to white in Xamarin Forms Android. 我想在Xamarin Forms Android中将ListViewItem的选定文本颜色设置为白色。

On iOS I can do it with custom ListViewRenderer and a custom UITableViewSource where I set the HighlightedTextColor. 在iOS上,我可以使用自定义ListViewRenderer和自定义UITableViewSource来设置HighlightedTextColor。

cell.TextLabel.HighlightedTextColor = UIColor.FromRGB(255, 255, 255);

Is there an equivalent for this in Android? 在Android中是否有相同的功能? I already tried it with the Resource.Attribute ColorControlActivated , but it is not working. 我已经使用Resource.Attribute ColorControlActivated尝试了它,但它无法正常工作。

//Android Color Class is in the root of the Resource Class         
     ListViewItem.TextColor = Android.Resource.Color.White;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM