0

For Android i was able to do it this way

protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
{
    base.OnElementChanged(e);
    if (e.OldElement == null && e.NewElement == null) return;
    Control.TextSize = 14f;
    Control.SetTextColor(Color.FromHex(Constants.Color.SLATE_GRAY).ToAndroid());
}

Is there any way for ios using Xamarin.Forms.Platform.ios.PickerRenderer? I could see an example in ios. link. But now sure how to convert it into Xamarin.

Anoop
  • 849
  • 3
  • 13
  • 28

1 Answers1

1

By clicking 'Go to Definition' ,you can find PickerRenderer inherit ViewRenderer<Picker, UITextField>

so we just set Font on Control , refer to the following code

protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
{
    base.OnElementChanged(e);

    if(Control != null)
    {
        Control.TextColor = UIColor.Red;
        Control.Font = UIFont.SystemFontOfSize(30);
    }
}
ColeX
  • 14,062
  • 5
  • 43
  • 240