Android 如何插入.gif格式的图像?

Android 如何插入.gif格式的图像?,android,eclipse,Android,Eclipse,你能给一些项目介绍如何在android上插入这样的图像吗?我想在我的xml中添加该图像 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > &l

你能给一些项目介绍如何在android上插入这样的图像吗?我想在我的xml中添加该图像

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

</RelativeLayout>


如何显示我的图像?

使用图像视图。它采用所有标准格式。

您可以使用ImageView:

<ImageView
    android:id="@+id/logo_small"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:src="@drawable/logo" />


并将图像文件放入
res/drawable/logo.gif
(或特定分辨率的可绘制目录中)

如果要显示移动的gif,则没有直接的方法,您必须尝试一种方法,请参阅下面的链接以了解更多详细信息

参考号


也可以在web视图中加载图像并显示它。(网络视图应该能够显示动画)

你能举个例子吗?如果你需要这么简单的例子,你需要重新阅读android教程。这几乎是一个Hello World应用程序。你打算用.gif来显示动画吗?不。我的图片是.gif格式的。我如何插入一个.gif格式的图片。这基本上与添加任何图片相同。甚至图片正在移动?如果图片正在移动(动画),请参考我的答案。你说的“图片正在移动”是什么意思?我的意思是,我的图像就像一个jpeg文件。我的图像是动画的。你能给我一个可以显示我的图像的webview的例子吗?