如何将ListView页脚设置为IsVisible = false

时间:2016-07-04 16:03:32

标签: c# xaml xamarin

这是页脚的XAML代码:

  <ListView.FooterTemplate IsVisible="{Binding IsLoading}">
    <DataTemplate>
      <StackLayout Padding="8">
        <Label Text ="Loading ..." 
               HorizontalOptions="CenterAndExpand"
               VerticalOptions="CenterAndExpand"/>
        <ActivityIndicator IsRunning="{Binding IsLoading}"                                                   
                Color="Blue" 
                HorizontalOptions="CenterAndExpand"
               VerticalOptions="CenterAndExpand"/>
      </StackLayout>
    </DataTemplate>        
  </ListView.FooterTemplate>

ActivityIndicator按预期工作(当IsLoading设置为false时停止)。但是,当IsLoading设置为false时,我想让整个页脚消失,​​而我无法实现这一点。

1 个答案:

答案 0 :(得分:0)

您必须为body#home_page .nav_item:nth-child(1), body#about_page .nav_item:nth-child(2), { background-color: red; /* more css styles that you want to give to your active menu item */ } 设置BindingContext,并将Footer更改为IsVisible

StackLayout