Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to overlay an ActivityIndicator in the middle of a StackLayout in XAML?

$
0
0

Given the following full screen StackLayout, how can I simply center an ActivityIndicator both vertically and horizontally over top of the StackLayout?

  <ScrollView BackgroundColor="#d3d6db">
    <StackLayout Orientation="Vertical"
                 VerticalOptions="FillAndExpand"
                 Padding="10">

      <Grid x:Name="SegmentGrid"
            RowSpacing="10"
            ColumnSpacing="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
      </Grid>
      <WebView BackgroundColor="White" VerticalOptions="FillAndExpand" Source="{Binding DescriptionHtml}" />


    </StackLayout>
  </ScrollView>

The activity indicator is simply

  <ActivityIndicator IsVisible="{Binding IsBusy}"
               IsRunning="{Binding IsBusy}"
               Color="Black"
               VerticalOptions="CenterAndExpand"
               HorizontalOptions="CenterAndExpand" />

Viewing all articles
Browse latest Browse all 58056

Trending Articles