Platform Specific Pickers in Xamarin Forms

Here’s a handy shortcut on how to make your Pickers do some OS-specific behaviors.

Problem: By default, once you open an iOS Picker it will select the first item, even if you don’t press the Done button. You can tell iOS to only select when the Done is pressed.

Add this reference to the top of your XAML page:

xmlns:iOsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"

Now you can tell the Picker to implement this iOS-only behaviour:

<Picker iOsSpecific:Picker.UpdateMode="WhenFinished"></Picker>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s