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

Picker rather wonky behaviour in Forms!?

$
0
0

Another difficult one to explain...

So, we've created a new app. From scratch. And when testing it, it does... unexpected things.

Everybody know what a picker is in Xamarin Forms. You add a list of data (usually, strings), and when you click it (or tap it, whatever you prefer), it shows a floating menu with the available options, alongside two buttons: accept and cancel. Simple stuff.

However, we've discovered that during the popup menu phase, if you click anywhere in the screen, the picker is unresponsive afterwards.
You click on it and nothing happens, no popup menu, nothing. This is increasingly weird, given that in our least recent apps clicking outside the menu causes nothing of the sort.

We know that the easy solution would be telling our users "be careful with the pickers, if you don't want to use them just press cancel".
However, our potential pool of users is way too big to do this. And even then, we all know how users tend to disregard this kind of advices. We need a more permanent solution to this, for future apps and whatnot.

I'll give you a brief example:

xaml pard:
<Picker x:Name="ratePicker" HorizontalOptions="FillAndExpand" SelectedIndexChanged="OnRateChange"/>

CS part:
`protected string rating;

ratePicker.ItemsSource = new List { "5", "4", "3", "2", "1" };

    void OnRateChange (object sender, EventArgs ev) {
        rating = (string) ((Picker) sender).SelectedItem;
    }

`

Best regards


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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