Drawable drawable = mContext.getResources().getDrawable(R.drawable.duringtime);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());//必须设置图片大小,否则不显示
holder.time.s...
分类:
其他好文 时间:
2014-11-19 15:57:14
阅读次数:
196
如何在Android中为TextView动态设置drawableLeft等两种方式:方式1:手动设置固有边界1 Drawable drawable = getResources().getDrawable(resId);2 //注意查看方法TextView.setCompoundDrawables(...
分类:
移动开发 时间:
2014-08-14 23:52:06
阅读次数:
278
如何在Android中为TextView动态设置drawableLeft等两种方式:方式1:手动设置固有边界1 Drawable drawable = getResources().getDrawable(resId);2 //注意查看方法TextView.setCompoundDrawables(...
分类:
移动开发 时间:
2014-08-12 21:34:24
阅读次数:
379
1.setCompoundDrawables(Drawableleft,Drawabletop,Drawableright,Drawablebottom) api:Sets the Drawables (if any) to appear to the left of, above, to the....
分类:
其他好文 时间:
2014-07-31 13:04:16
阅读次数:
246
textView.setCompoundDrawables(drawable, null, null, null);时看不到ni...
分类:
移动开发 时间:
2014-07-08 12:50:15
阅读次数:
283
TextView是一个很强大的控件,有时需要在一个控件中同时显示图片和文字,使用TextView很容易实现。
方法一:
聊天软件比如QQ一般都会有发送表情的功能,使用SpannableString+ImageSpan可以很容易实现
[java]
view plaincopy
private void showImageFace(String s,View v) ...
分类:
其他好文 时间:
2014-06-14 06:10:31
阅读次数:
327
手工设置文本与图片相对位置时,常用到如下方法:
setCompoundDrawables(left, top, right, bottom)
setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom)
意思是设置Drawable显示在text的左、上、右、下位置。
但是两者有些区别:
setCompoun...
分类:
移动开发 时间:
2014-06-14 00:18:45
阅读次数:
491
Android中有时需动态设置控件四周的drawble图片,这个时候就需要调用
setCompoundDrawables(left, top, right,
bottom),四个参数类型都是drawableButton继承TextView,所以可以采用相同的设置方法方法一.XML方式方法二.JAVA...
分类:
移动开发 时间:
2014-06-08 01:17:39
阅读次数:
430