How to change the TableSection text color with a custom renderer - Xamarin.Forms C#

Viewed 1974

I have a TableView with 3 TableSections in the root:

var tableView = new TableView
{
  RowHeight = 60,
  Root = new TableRoot
  {
    firstTableSection,
    secondTableSection,
    thirdTableSection,

  }
}

var firstTableSection = new TableSection("First")
{
  // Cells
}

var firstTableSection = new TableSection("First")
{
  // Cells
}

var firstTableSection = new TableSection("First")
{
  // Cells
}

How can you change the text color of the TableSection text with a custom renderer?

public class TestTableViewRenderer : Xamarin.Forms.Platform.Android.TableViewRenderer
{
    protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.TableView> e)
    {
        base.OnElementChanged(e);

        // Not sure how to add this property here

    }
}
2 Answers
Related