添加gif效果图

时间:2022-08-07 09:56:54

添加gif效果图

1.贴加第三方包

http://blog.csdn.net/iamlazybone/article/details/5972234

2.

<FrameLayout
android:id="@+id/search_content_read_fl"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp" > <ImageView
android:id="@+id/search_content_read_img"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/maek_garden_color"
android:padding="10dp"
android:scaleType="centerInside"
android:src="@drawable/index_2" /> <com.ant.liao.GifView
android:id="@+id/search_content_read_img2"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/maek_garden_color"
android:padding="10dp"
android:scaleType="centerInside"
/> </FrameLayout>

3.

gif_no = (ImageView) findViewById(R.id.search_content_read_img);
gif = (GifView) findViewById(R.id.search_content_read_img2);
gif.setGifImage(R.drawable.index_2_gif);
gif.setShowDimension((int) CommonUtil.getDimen(R.dimen.gif_contend_hei),
(int) CommonUtil.getDimen(R.dimen.gif_contend_wid));
gif_no.setVisibility(View.INVISIBLE);
gif.setVisibility(View.VISIBLE);

总结,实现点击隐藏,用一张图片替换gif图。