Forum Xamarin.Forms

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:

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

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

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


  • aarthidlaarthidl USMember ✭✭

    Replace "x:LayoutOptions" with "LayoutOptions"

  • aarthidlaarthidl USMember ✭✭

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

Sign In or Register to comment.