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

Custom DatePicker renderer for Windows Phone 8.1

$
0
0

I have a date picker on a white background. This obviously doesn't work by default, because the text is white. I was able to change the text color on Android using a custom renderer:

protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.DatePicker> e)
{
base.OnElementChanged(e);
this.Control.SetTextColor(Android.Graphics.Color.Gray);
}

In Windows Phone 8.1, what do I use?

public class MyDatePickerRederer : DatePickerRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.DatePicker> e)
{
base.OnElementChanged(e);

    }
}

There is no SetTextColor method of course. I tried setting the background color to gray, and that renders. However, when someone selects a date, the text disappears.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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