Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to change font size of listitems of a custom picker?

Hi guys,

I have the next renderer of a picker:

` public class BindablePickerRenderer : PickerRenderer
{

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

        if (Control != null)
        {

            TextView label = (TextView)Control;

            BindablePicker picker = this.Element as BindablePicker;
            var pickerStyle = new Style(typeof(Picker))
            {
                Setters = {
                    new Setter {Property = Picker.BackgroundColorProperty, Value = Color.Blue},
                    new Setter {Property = Picker.TextColorProperty, Value = Color.Gray},
                }
            };



            //picker.TextColor = Color.Blue;
            picker.Style = pickerStyle;
            label.TextSize = picker.HeaderTextSize;
            label.SetTextColor(Android.Graphics.Color.Black);
            label.Text = picker.Title;
        }

    }

}`

I can change the textSize of the title but the Items of list to select one value are so tiny.

Which is the correct way for customizing this?

Sign In or Register to comment.