MullerA
MullerA

Reputation: 387

Why is my picker in Xamarin.Forms not showing

I'm trying to add a picker in my XAML code in Xamarin.Forms but strangely enough, it refuses to show up. Help please!

Here is my code;

<StackLayout>

    <Label Text="Welcome"
     VerticalOptions="Start"
     Margin="0,150,0,0"
     HorizontalTextAlignment="Center"
     Rotation="0"
     IsVisible="true"
     FontSize="20"
     TextColor="Black"></Label>


    <Picker x:Name="IndustryTypePicker1" Title="Select">
        <Picker.Items>
            <x:String>1</x:String>
            <x:String>2</x:String>
        </Picker.Items>
    </Picker>


</StackLayout>

Code

Upvotes: 2

Views: 1053

Answers (1)

Jason
Jason

Reputation: 89204

Read the docs

However, a Picker doesn't show any data when it's first displayed.

When the Picker gains focus, its data is displayed and the user can select an item:

Upvotes: 2

Related Questions