代码之家  ›  专栏  ›  技术社区  ›  sharkyenergy

Activityindicator无法加载图像

  •  0
  • sharkyenergy  · 技术社区  · 4 年前

        <ContentPage.Content>
        <StackLayout>
            <local:PinchPanContainer>
                <local:PinchPanContainer.Content HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                    <ffimageloading:CachedImage RetryCount="5" RetryDelay="1" CacheDuration="1" x:Name="MyImage" HorizontalOptions="Fill" VerticalOptions="CenterAndExpand" DownsampleToViewSize="False"></ffimageloading:CachedImage>
                </local:PinchPanContainer.Content>
            </local:PinchPanContainer>
            <ActivityIndicator BindingContext="{x:Reference MyImage}" IsRunning="{Binding CachedImage.IsLoading}"  IsVisible="{Binding CachedImage.IsLoading}"/>
        </StackLayout>
    </ContentPage.Content>
    
    0 回复  |  直到 4 年前
        1
  •  2
  •   nevermore    4 年前

    您使用的绑定路径不正确,应该是正确的 IsLoading 而不是 CachedImage.IsLoading :

    <StackLayout>
        <ffimageloading:CachedImage Source="http://img1.wikia.nocookie.net/__cb20101219155130/uncyclopedia/images/7/70/Facebooklogin.png" LoadingDelay="2000" RetryCount="5" RetryDelay="1" CacheDuration="1" x:Name="MyImage" HorizontalOptions="Fill" VerticalOptions="CenterAndExpand" DownsampleToViewSize="False"></ffimageloading:CachedImage>
        <ActivityIndicator BindingContext="{x:Reference MyImage}" Color="Red" IsRunning="{Binding IsLoading}"  IsVisible="{Binding IsLoading}"/>
    </StackLayout>
    

    data-binding-basics

    推荐文章