I have loaded Gif image using webview in Alert dialog but black background image is displayed with Gif image....I have not mentioned any background image for alert and also webview then how black background image is displayed????
我在Alert对话框中使用webview加载了Gif图像,但是用Gif图像显示了黑色背景图像....我没有提到任何用于警报的背景图像以及webview然后如何显示黑色背景图像????
2 个解决方案
#1
1
you can try this load your gif in to imageview using glide
你可以尝试使用滑动将你的gif加载到imageview
compile
编
compile 'com.github.bumptech.glide:glide:4.0.0'
load Gif using glide
使用滑动加载Gif
Glide.with(YourActivity.this)
.load(gif)
.into(imageview);
#2
0
Add this into your buil.gradle dependencies
将其添加到您的buil.gradle依赖项中
dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
}
then
然后
The simplest way is to use GifImageView in your xml like this
最简单的方法是在你的xml中使用GifImageView
<pl.droidsonroids.gif.GifImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/src_anim"
android:background="@drawable/bg_anim"
/>
#1
1
you can try this load your gif in to imageview using glide
你可以尝试使用滑动将你的gif加载到imageview
compile
编
compile 'com.github.bumptech.glide:glide:4.0.0'
load Gif using glide
使用滑动加载Gif
Glide.with(YourActivity.this)
.load(gif)
.into(imageview);
#2
0
Add this into your buil.gradle dependencies
将其添加到您的buil.gradle依赖项中
dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
}
then
然后
The simplest way is to use GifImageView in your xml like this
最简单的方法是在你的xml中使用GifImageView
<pl.droidsonroids.gif.GifImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/src_anim"
android:background="@drawable/bg_anim"
/>