Android:如何在Glide或毕加索的占位符中使用TextView [英] Android: How to use TextView in placeholder of Glide or Picasso

查看:83
本文介绍了Android:如何在Glide或毕加索的占位符中使用TextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Glide或Picasso加载图像,例如

i am using Glide or Picasso for loading the image like

Glide.with(context).load(POST_IMAGE).placeholder(R.drawable.loading_img).error(R.drawable.bg_480_800).into(image);


Picasso.with(context).load("image url").error(R.drawable.bg_480_800).placeholder(R.drawable.loading_img).into(holder.imageURL);

在这两个中,我将图像用作可绘制文件夹中的占位符.现在,我想在占位符内使用文本,而不是可绘制文件夹中的图像.

In these two, i'm using image as place holder from the drawable folder. Now i want to use text inside the place holder instead of image from drawable folder.

所以,请帮助我加载文本,而不是从drawable文件夹中加载图像

So, please help me to load text instead of loading image from the drawable folder

推荐答案

占位符是一个 Drawable ,因此您需要的是某种 Drawable 显示文字.这个库完全可以做到,而且效果很好.

Placeholder is a Drawable, so what you'll need is some kind of Drawable that is able to display text. This library does exactly that, and does it pretty well.

这篇关于Android:如何在Glide或毕加索的占位符中使用TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆