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

How can I break the text in a Picker's selection dialog wrap when too long?

$
0
0

I'm working with Xamarin.Forms, and the problem that I'm running into is wrapping text in the selection dialog

When the text is very long exceed the limit and does not show the rest of the text, I want to intend to break line when the text is long

public class CustomPickerRenderer : PickerRenderer
{
public CustomPickerRenderer(Context context) : base(context) { }

    CustomPicker element;

    protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
    {
        base.OnElementChanged(e);
        element = (CustomPicker)this.Element;

        if (Control != null && this.Element != null);
        var et = this.Control as EditText;
        Control.SetMaxLines(3);
        Control.Ellipsize = TextUtils.TruncateAt.End;
        Control.SetTextSize(Android.Util.ComplexUnitType.Sp, 15f);
        Control.SetSingleLine(false);
       // et.SetSingleLine(true);


          }  
    }

Viewing all articles
Browse latest Browse all 91519

Trending Articles



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