How do I set VerticalOptions in Xaml ResourceDictionary OnPlatform

NielsCupNielsCup ✭✭✭NLMember ✭✭✭

I am trying to vertically position my activityindicator per platform in Xaml, something like this:

<ContentPage.Resources>
    <ResourceDictionary>
       <OnPlatform x:Key="ActivityIndicatorPosition" x:TypeArguments="x:LayoutOptions" iOS="Center" Android="Center" WinPhone="Start" />
    </ResourceDictionary>
</ContentPage.Resources>

<ActivityIndicator VerticalOptions="{StaticResource ActivityIndicatorPosition}"/>

But the OnPlatform part throws "An unhandled exception occurred". Does anybody have an idea how to fix this?

Posts

  • aarthidlaarthidl ✭✭ USMember ✭✭

    Replace "x:LayoutOptions" with "LayoutOptions"

  • aarthidlaarthidl ✭✭ USMember ✭✭

    Replace "x:LayoutOptions" with "LayoutOptions". (Remove " x: ")

Sign In or Register to comment.