Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Xamarin forms Listview selected item text color change

$
0
0

I am working with list view using tamarin forms.
I need to change the background color and text color of the selected item in list view. I have achieved the background color change using custom renderer.
But i am not able to change the text color of selected item.
Can you please help me out. I have given the code snippet here. This is for IOS platform.

public class CustomTextCellRenderer: ViewCellRenderer
{
private UIView bgView;

    public override UITableViewCell GetCell (Cell item, UITableViewCell reusableCell, UITableView tv)
    {
        var cell = base.GetCell (item, reusableCell, tv);
        if (bgView == null)
        {
            bgView = new UIView {
                BackgroundColor = UIColor.FromRGB(6,51,110),
            };
        }

        cell.SelectedBackgroundView = bgView;
        cell.TextLabel.HighlightedTextColor = UIColor.Red;
        return cell;
    }

}


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>