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

Height of Picker in Xamarin.Forms

$
0
0

I'm using xamarin.forms and displaying Bindable picker on screen.

And I'm using following code to update initial text of Picker contol.

           public class MyCustomBindablePickerRenderer :PickerRenderer
               {
                // Override the OnElementChanged method so we can tweak this renderer post-initial setup
                protected override void OnElementChanged (ElementChangedEventArgs<Picker> e)
                {
                        base.OnElementChanged (e);

                        //Background = A Android.Graphics.Color.Rgb (0, 0, 0);
                        if (Control != null) { 
                            // do whatever you want to the textField here!

                            Control.SetBackgroundColor(global::Android.Graphics.Color.Rgb(241,241,241));
                            //Control.ShadowRadius = 2;
                            //Control.SetCursorVisible = true;


                            var label = (TextView)Control; // for example
                            Typeface font = Typeface.CreateFromAsset (Forms.Context.Assets, "avenir-book.ttf");
                            label.Typeface = font;
                            label.TextSize = CustomFonts.EntryFontSize;
                            label.SetHintTextColor (global::Android.Graphics.Color.Rgb(162,162,162));
                            label.SetTextColor (global::Android.Graphics.Color.Rgb(162,162,162));


                        }
                    }
                }

Now, i want to increase the size of popup that appears while clicking the text.

I have googled and found event OnWindowFocusChanged, but the event fires after popup appears so there is no way i can access the height of popup.

Can any one suggest the event fires when i click on textbox of picker control?

And how can I change height of the popup?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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