xamarin/Xamarin.Forms

XF 3.6 Material Setting in App.Xaml requires default value

Ouverte

#5 733 ouverte le 28 mars 2019

 (3 commentaires) (1 réaction) (0 personne assignée)C# (1 926 forks)batch import
a/visuale/2 :clock2:good first issuehelp wantedinactivet/bug :bug:up-for-grabs

Métriques du dépôt

Stars
 (5 644 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

I love Xamarin Forms...now on to the bug/feature?...

In my app.xaml I create a Style for ContentPages to apply Material to only iOS pages due to a bug in Android Material in XF 3.6 preventing me from using it in Android for now:

<Style TargetType="ContentPage" ApplyToDerivedTypes="true"> <Setter Property="Visual"> <Setter.Value> <OnPlatform x:TypeArguments="IVisual" iOS="Material" /> </Setter.Value> </Setter> </Style>

Running in Android throws the error:

System.ArgumentException: Value was an invalid value for Visual Parameter name: value

Adding the Default to Android this fixes it, but shouldn't default be default?

<OnPlatform x:TypeArguments="IVisual" iOS="Material" Android="Default" />

Expected Behavior

Default values shouldn't need to be set?

Actual Behavior

Default is required

Basic Information

  • Android: 9

Guide contributeur