NativeScript plugin to use .gifs
Android Library | iOS CocoaPod |
---|---|
Koral-- / android-gif-drawable | FLAnimatedImage by Flipboard |
npm install nativescript-gif
or tns plugin add nativescript-gif
Android Screen | iOS Screen |
---|---|
IMPORTANT: Make sure you include
xmlns:Gif="nativescript-gif"
on the Page element.
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:Gif="nativescript-gif" loaded="pageLoaded">
<StackLayout>
<Gif:Gif src="~/gifs/bill.gif" height="100" />
<Gif:Gif src="https://media4.giphy.com/media/3uyIgVxP1qAjS/200.gif" height="200" />
</StackLayout>
</Page>
import { registerElement } from "nativescript-angular/element-registry";
registerElement("Gif", () => require("nativescript-gif").Gif);
<StackLayout>
<Gif src="~/gifs/bill.gif" height="100" ></Gif>
<Gif src="https://media4.giphy.com/media/3uyIgVxP1qAjS/200.gif" height="200" ></Gif>
</StackLayout>
- starts playing the .gif
- stops playing the .gif
- returns the number of frames in the current .gif
- returns boolean value indicating if the gif is playing.
- returns the .gif duration
- resets the .gif to its initial frame
- sets the .gif play speed
- provided to speed up freeing memory advanced usage - you shouldn't need this often