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

How can I make the text wrap for long text in picker items

$
0
0

Is there a way to set the items in picker to wrap after they hit a certain length? I see that you can set the entire picker's widthrequest but that doesn't seem to do anything for long strings inside the picker's item list. Sample code below:

private readonly List<string> sampleQuestions = new List<string>
                                                              {                                                                  
                                                                  "Long text goes here but I want it to wrap after X amount of width",
                                                                  "No wrap here"                                                                  
                                                              };

var myPicker = new Picker
                                            {
                                                 HorizontalOptions = LayoutOptions.Center,                                                 
                                                 Title = "My picker",                                                 
                                            };

 foreach (string pickerText in sampleQuestions)
            {
                myPicker.Items.Add(pickerText);
            }

Viewing all articles
Browse latest Browse all 91519

Trending Articles



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