Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 活动指示灯未处于正确位置_C#_Xaml_Xamarin.forms - Fatal编程技术网

C# 活动指示灯未处于正确位置

C# 活动指示灯未处于正确位置,c#,xaml,xamarin.forms,C#,Xaml,Xamarin.forms,请帮助我如何将活动指示器置于正确位置。 在所有平台上,它并没有进入正确的位置,而是进入顶部而不是设备的中心 <ScrollView> <Grid BackgroundColor="#3F51B5"> <Grid.RowDefinitions> <RowDefinition Height="auto"></RowDefinition> <

请帮助我如何将活动指示器置于正确位置。 在所有平台上,它并没有进入正确的位置,而是进入顶部而不是设备的中心

<ScrollView>
        <Grid BackgroundColor="#3F51B5">
            <Grid.RowDefinitions>
              <RowDefinition Height="auto"></RowDefinition>
              <RowDefinition Height="auto"></RowDefinition>
              <RowDefinition Height="auto"></RowDefinition>
              <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>

            <StackLayout Padding="20" Grid.Column="0" Grid.Row="0"  >
              <Image Source="panel.jpg"/>
            </StackLayout>
            <StackLayout Padding="20" Grid.Column="0" Grid.Row="1">
              <Entry />
            </StackLayout>
            <StackLayout Padding="20" Grid.Column="0" Grid.Row="2">
              <Entry />
            </StackLayout>
            <StackLayout  Padding="20" HorizontalOptions="FillAndExpand" Grid.Column="0" Grid.Row="3">
              <Label/>
            </StackLayout>
            <ActivityIndicator x:Name ="LoadingLogin" IsRunning="False" IsVisible="False" Color="Black" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>

        </Grid>
    </ScrollView>


Thanx提前

要在屏幕中心显示
ActivityIndicator
,您必须将其包装在
ContentView
中,如下所示:



不要忘记,当显示
ActivityIndicator
时,所有其他视图都应该显示
IsVisible=false

让你在所有平台上测试这些代码,它是否工作是的,我经常使用它。它确实适用于每个平台。你能帮我只使用我的代码吗?我将如何使用你的代码,因为我正在尝试你的代码。它不起作用。当activityIndicator可见时,你的代码是否阻止了所有单击事件
<ContentView HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" IsVisible="true">
     <ActivityIndicator x:Name ="LoadingLogin" IsRunning="False" IsVisible="False" Color="Black" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>
</ContentView>