【发布时间】:2020-02-12 12:25:34
【问题描述】:
我有很多尝试在 Loader 之后显示 EmptyView 但没有成功可能我错过了 EmptyView 和 Loader 的一些代码配置。
我正在使用 ActivityIndicator 加载器来加载视图,如果它会在数据到来时隐藏。
以下代码用于 CarouselView 的 EmptyView
<CarouselView.EmptyView>
<Frame BackgroundColor="Transparent" Margin="20,150">
<Frame BackgroundColor="White" CornerRadius="20" HeightRequest="150" WidthRequest="300" HorizontalOptions="Center" VerticalOptions="Center">
<Label Text="Data not Found" FontSize="Medium" HorizontalOptions="Center" VerticalOptions="Center"/>
</Frame>
</Frame>
</CarouselView.EmptyView>
以下代码用于 ActivityIndicator
<StackLayout IsVisible="{Binding IsBusy}" Padding="12" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1">
<ActivityIndicator IsRunning="{Binding IsBusy}" Color="#BFA464" x:Name="PaymentLoader"/>
<Label Text="Data is Loading..." HorizontalOptions="Center" TextColor="#BFA464"/>
</StackLayout>
下图是我的整个代码截图
如果有人有想法,请分享您的宝贵知识。
【问题讨论】:
-
也许你可以试试
xamarinexpert.it/how-to-invert-a-boolean-value