Pizhev Racing
Pizhev Racing

Reputation: 486

Why some .gif icons not playing on android project xamarin

I want to display some .gif icons on android project.. but many icons not moving.. I don't know why.. ?

I have a <Image/> with propertie: IsAnimationPlaying="True" and this work only for three gifs and other gifs not moved...

                    <Image Source="rain.gif"
                           IsAnimationPlaying="True"
                           WidthRequest="40"
                           HeightRequest="40"
                           Grid.Row="2"
                           Grid.Column="1"/>

In drawable folder I set all gifs to AndroidResource property but this not work..

Аnd after all, the icon is not the one I placed in drawable folder.

I set rain.gif who is not this one from the screenshot.

This is not the icon who I set

This is real icon rain.gif: rain.gif

So the first three .gif icons is moved and worked (thermometers), other .gif icons not worked and rain.gif is different I don't know why ?

Could it be that the problem is that I have the same name with different extensions in drawable folder, like: rain.jpg rain.png...

I try many times to clear the project and build again and again but not worked for me..

Upvotes: 0

Views: 106

Answers (1)

Leo Zhu
Leo Zhu

Reputation: 15001

Becasue Android doesn't have built-in support for loading gif into ImageViews. You could display gif with some commonly used third-party controls.

Like FFImageLoading

<ffimageloading:SvgCachedImage Source="rain.gif" WidthRequest="40"
                       HeightRequest="40"
                       Grid.Row="2"
                       Grid.Column="1"/>

Upvotes: 1

Related Questions