概述
glide 4.7.1 加载gif
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:gravity="center"
android:layout_gravity="center"
android:background="#f9f9f9"
android:layout_width="match_parent"
android:layout_height="50dp">
android:backgroundTint="#fe461c"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_gravity="center">
android:id="@+id/pulling"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
/>
android:id="@+id/pullok"
android:gravity="center"
android:layout_gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
/>
android:id="@+id/pullrelease"
android:gravity="center"
android:layout_gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
/>
private void initView(ReactContext context) {
this.reactContext = context;
header = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.header,null);
pulling = header.findViewById(R.id.pulling);
pullok = header.findViewById(R.id.pullok);
pullrelease = header.findViewById(R.id.pullrelease);
Glide.with(context).asGif().load(R.mipmap.pullrelease).into(pulling); //不能显示
Glide.with(context).asGif().load(R.mipmap.pullrelease).into(pullrelease); //不能显示
pullok.setImageResource(R.mipmap.pullok); //能显示
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
params.gravity= Gravity.CENTER;
this.addView(header,params);
}
最后
以上就是朴素冬天为你收集整理的android显示动态图片不显示,andorid 加载gif图片不显示的全部内容,希望文章能够帮你解决android显示动态图片不显示,andorid 加载gif图片不显示所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复