Gilde加载网络图片到TextView的DrawableTop
来源:互联网 发布:深圳云计算招聘岗位 编辑:程序博客网 时间:2024/06/07 06:53
Gilde加载网络图片到TextView的DrawableTop
普通设置本地Drawable方法
代码块
代码块语法遵循标准markdown代码,例如:
Drawable drawable1=getResources().getDrawable(R.drawable.lock); /// 这一步必须要做,否则不会显示. drawable1.setBounds(0,0,drawable1.getMinimumWidth(),drawable1.getMinimumHeight());tvTitle.setCompoundDrawables(drawable1,null,null,null);
所以遇到的问题就是如何将网络URL图片转化成Drawable图片并设置进去
具体方法看代码
//网络加载成功更改tv drawable图片:private void openBidevent(List<HomeNewBean.IconsBean> mPictureList, final List<TextView> textViews, final List<ImageView> imageViews,String string) { for(int i=0;i<mPictureList.size();i++){ final int finalI = i; Glide.with(getActivity()).load(string+mPictureList.get(i).getPicPath()).asBitmap().into(new SimpleTarget<Bitmap>(){@OverrideGlideAnimation<? super Bitmap> glideAnimation) { BitmapDrawable drawable= new BitmapDrawable(getActivity().getResources(), resource); /// 这一步必须要做,否则不会显示. drawable.setBounds(0,0,drawable.getMinimumWidth(),drawable.getMinimumHeight()); textViews.get(finalI).setCompoundDrawables(null,drawable,null,null); } }); textViews.get(i).setText(mPictureList.get(i).getTitle()); } }
阅读全文
0 0
- Gilde加载网络图片到TextView的DrawableTop
- RecyclerView瀑布流的形式利用Gilde加载网络图片
- 如何给textView的drawableTop更换图片
- Gilde图片加载框架的使用
- Gilde加载圆形图片
- Gilde加载图片
- 视图的隐藏显示附加Gilde加载图片模版
- 揭秘之从RecyclerView滑动监听到Gilde平滑加载图片
- 揭秘之从RecyclerView滑动监听到Gilde平滑加载图片
- 揭秘之从RecyclerView滑动监听到Gilde平滑加载图片
- 常用的图片加载库的区别(Gilde,Picasso,Image-loader,Fresco)
- 常用的图片加载库的区别(Gilde,Picasso,Image-loader,Fresco)
- 代码中设置TextView的drawableTop
- 使用Gilde加载图片时裁剪大小异常
- 图片加载框架之Gilde详细讲解(一)
- 图片加载框架之Gilde详细讲解(二)
- Picasso图片加载网络图片到ViewGroup的背景
- TextView加载HTML数据(网络图片以及图片点击事件的实现)
- 【Person Re-ID】In Defense of the Triplet Loss for Person Re-Identification
- CSS基础(7.初识margin)
- 5种语言的callback实现
- 字符串的交错组成 动态规划
- 为什么使用redis
- Gilde加载网络图片到TextView的DrawableTop
- SparkWordCount源码原理
- iOS UIView设置背景图片4种方式
- glup 构建一个完整的jquery项目
- Non-maxing supressing非最大值抑制
- codeforces 485D. Maximum Value
- ON1 Photo RAW 2017(RAW格式图片处理工具)官方正式版V12.0.0.4006下载 | on1 photo raw 破解版下载
- RxJava(二:Observable 创建,组合与过滤)
- 添加子菜单