两个Android开源项目:Android显示GIF动画,零基础入门android

本文介绍了两个Android开源项目,专注于显示GIF动画。文章详细阐述了如何在XML和Java代码中使用GifImageView和GifImageButton,并提供了动画控制的方法,如start(), stop(), seekTo()等。此外,还提到了Android开发者的个人经历和一份全面的Android学习资源分享。" 123374953,11747886,五子棋悔棋功能实现,"['Java', '后端开发', '游戏开发']
摘要由CSDN通过智能技术生成

2. <groupId>pl.droidsonroids.gif</groupId>

3. <artifactId>android-gif-drawable</artifactId>

4. <version>insert latest version here</version>

5. <type>aar</type>

6. </dependency>

Requirements

Android 1.6+ (API level 4+)

Building from source

Android NDK needed to compile native sources

Usage

From XML

The simplest way is to use GifImageView (or GifImageButton) like a normalImageView:

view source print ?

1. <pl.droidsonroids.gif.GifImageView

2. android:layout_width=``"match_parent"

3. android:layout_height=``"match_parent"

4. android:src=``"@drawable/src_anim"

5. android:background=``"@drawable/bg_anim"

6. />

If drawables declared by android:src and/or android:background are GIF files then they will be automatically recognized asGifDrawables and animated. If given drawable is not a GIF then mentioned Views work like plainImageView and ImageButton.

GifTextView allows you to use GIFs as compound drawables and background.

view source print ?

1. <pl.droidsonroids.gif.GifTextView

2. android:layout_width=``"match_parent"

3. android:layout_height=``"match_parent"

4. android:drawableTop=``"@drawable/left_anim"

5. android:drawableStart=``"@drawable/left_anim"

6. android:background=``"@drawable/bg_anim"

7. />

From Java code

GifImageView, GifImageButton and GifTextView have also hooks for setters implemented. So animated GIFs can be set by cal

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值