Picker Title Color in ios

BasuBasu USMember ✭✭

Hi,
How to Change Picker Title Color in ios

Answers

  • Mounika.KolaMounika.Kola USMember ✭✭✭

    @Basu

    Are you using custom renders or cross platform ?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    https://github.com/FormsCommunityToolkit/Effects/blob/master/src/Effects.iOS/Effects/ChangeColorSwitchEffect.cs

    I have used this code for XF Effects. Maybe you can find an asnwer here

  • BasuBasu USMember ✭✭

    @Mounika Kola s im using custom renderer but it giving null reference exception
    public class BluePickerRendere:PickerRenderer
    {

        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Picker> e)
        {
            base.OnElementChanged(e);
    
            if (this.Control == null) return;
            this.Control.AttributedPlaceholder = new Foundation.NSAttributedString(this.Control.AttributedPlaceholder.Value, foregroundColor: UIColor.FromRGB(6, 140, 201));
            this.Control.Font = UIFont.FromName("Proxima Nova", 15.0f);
            this.Control.BackgroundColor = UIColor.Clear;
            this.Control.TextColor = UIColor.FromRGB(6, 140, 201);
            this.Control.BorderStyle = UITextBorderStyle.None;
            this.Control.Layer.BorderColor = UIColor.White.CGColor;
        }
        }
    
  • BasuBasu USMember ✭✭

    @Alessandro Caliaro
    Thanx Alessandro Caliaro, but i need picker title color

  • LibinJosephLibinJoseph NZDeveloper Group Leader ✭✭

    Control.AttributedPlaceholder = new Foundation.NSAttributedString(Control.AttributedPlaceholder.Value, foregroundColor: Color.FromHex("FFFFFF").ToUIColor());

    Add this code to your custom renderer and it will be all good. Even better, if you make the color property bindable from XAML

Sign In or Register to comment.