Select in Xamarin Forms, how would it be?

Asked

Viewed 565 times

0

I am creating a contact form in Xamarin, and should have an option for the user to select the desired purpose, ie in html would exist a tag select with all the option, so what tags are used to create this in Xamarin?

2 answers

2

In the Android and in the Xamarin.droid is known as Spinner, in the ios I found nothing on.

Here is a discussion about the Spinner in the Forms: https://forums.xamarin.com/discussion/55637/how-to-use-spinner-in-xamarin-forms. Here a lib to implement this in Forms (which is suggested in the above discussion): https://github.com/amccorma/xamarin-amccorma/tree/master/Forms.DropDown

There is also the Picker official of Xamarin, but the design doesn’t look very cool (in Android, for example, a AlertDialog with the options, and not a Spinner in itself) https://developer.xamarin.com/api/type/Xamarin.Forms.Picker/ (There are images to see how it is)

0


So in a search here in the documentation Xamarin I found what is used to replace the select in the Xamarin, thus being a select with the option necessary would be so:

<Picker x:Name="pckFinalidade" HorizontalOptions="FillAndExpand" Title="Escolha a finalidade">
                    <Picker.Items>
                        <x:String>CORREÇÃO DE ERRO</x:String>
                        <x:String>MELHORIA DE SISTEMA</x:String>
                        <x:String>NOVA FUNCIONALIDADE</x:String>
                        <x:String>NOVO RELATÓRIO/ETIQUETA</x:String>
                        <x:String>OBRIGAÇÕES FISCAIS</x:String>
                        <x:String>MIGRAÇÃO DE SISTEMA</x:String>
                    </Picker.Items>
                </Picker>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.