HorusSoftwareUY / Xamarin.Forms.Skeleton

The new loading approach for cool apps in Xamarin Forms
MIT License
452 stars 52 forks source link

Shimmer/Skeleton is not working for label on iOS #24

Open iamchandanys opened 3 years ago

iamchandanys commented 3 years ago

The below piece of code is working differently on both Android & iOS. I mean the Skeleton for label is not displaying on iOS but the same is displaying on Android. The Android & iOS screenshot is attached at the bottom.

<StackLayout 
        Spacing="50"
    Padding="16"
    Margin="0,0,0,10"
    sk:Skeleton.IsParent="True"
    sk:Skeleton.IsBusy="{Binding ShowShimmer}"
    sk:Skeleton.Animation="{sk:DefaultAnimation Fade, Interval=300}"
    sk:Skeleton.BackgroundColor="{StaticResource ShimmerPrimary}">

    <StackLayout Spacing="16" Orientation="Horizontal">

        <ffimageloading:CachedImage 
                        WidthRequest="80"
            HeightRequest="80"
                    sk:Skeleton.IsBusy="{Binding ShowShimmer}"
            sk:Skeleton.BackgroundColor="{StaticResource ShimmerSecondary}" />

        <StackLayout Spacing="2" HorizontalOptions="FillAndExpand">

            <Label FontSize="Small"
                   sk:Skeleton.IsBusy="{Binding ShowShimmer}"
                   sk:Skeleton.BackgroundColor="{StaticResource ShimmerSecondary}" />

            <Label FontSize="Small"
                   sk:Skeleton.IsBusy="{Binding ShowShimmer}"
                   sk:Skeleton.BackgroundColor="{StaticResource ShimmerSecondary}" />

        </StackLayout>

    </StackLayout>
</StackLayout>

Android Screenshot:

Android

iOS Screenshot:

iOS

xleon commented 3 years ago

Same issue here

iamchandanys commented 3 years ago

Same issue here

@xleon Use the Frame instead of Label. This is what I did.

NelsonSantos commented 3 years ago

Seems that you don't put any value on Label's Text property, nor bind it with some viewModel's property

iamchandanys commented 3 years ago

Seems that you don't put any value on Label's Text property, nor bind it with some viewModel's property

@NelsonSantos Then how come its working in Android without binding text?

Anyway I'll try your suggestion.

abhcr commented 3 years ago

Xamarin 5 iOS - When you have multiple labels inside a stacklayout, only the first one shows the animation when IsBusy is true. I have tried forcing Hide=false on all still not working. Works fine on android though,