TextView——setCompoundDrawables
来源:互联网 发布:python pip安装windows 编辑:程序博客网 时间:2024/05/01 15:36
TextView可以用过调用setCompoundDrawables设置一张图片出现在上下左右四个地方。代码如下
Drawable drawable = getResources().getDrawable(R.drawable.img); drawable.setBounds(0, 0, 32, 32); textView.setCompoundDrawables(drawable, null, null, null);
public void setCompoundDrawables (Drawable left, Drawable top, Drawable right, Drawable bottom)Since: API Level 1Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use null if you do not want a Drawable there. The Drawables must already have had setBounds(Rect) called.
注意到这个Drawables必须已经调用过了setBounds。
public void setBounds (int left, int top, int right, int bottom)Since: API Level 1Specify a bounding rectangle for the Drawable. This is where the drawable will draw when its draw() method is called.
- TextView——setCompoundDrawables
- TextView——setCompoundDrawables用法
- TextView——setCompoundDrawables用法
- TextView setCompoundDrawables()
- textView-setCompoundDrawables方法解析
- 关于 TextView.setCompoundDrawables() 无效
- TextView setCompoundDrawables不显示
- textview.setCompoundDrawables不显示图片
- ImageView加TextView可以用setCompoundDrawables代替
- TextView设置setCompoundDrawables或setCompoundDrawablesWithIntrinsicBounds区别
- TextView的setCompoundDrawables不显示问题解决
- TextView,Button 等设置 setCompoundDrawables 无效
- TextView,Button 等设置 setCompoundDrawables 无效
- Android TextView setcompounddrawables 图片不显示的问题
- 获取listview中的子元素view, 设置textview的图标:setCompoundDrawables使用, view.textView.getHeight()为0
- setCompoundDrawables使用
- setCompoundDrawables使用
- android TextView如何通过setCompoundDrawables调整文字和图片的位置(文字显示在图片内)?
- 严于律己,宽以待人
- 绑定DropDownList的中的值
- 简明 Vim 练级攻略
- 排序完全由字母字符串组成的数组
- winform最小化至托盘、右下角弹框提示
- TextView——setCompoundDrawables
- 寒如月华
- XAMPP Apache Service is already running on port 443
- 模版与泛型编程--<c++ primer>16章
- 金额中文大写转换工具类
- 几种比较好用的.htaccess配置
- js中this关键字的使用
- hdu 1370 中国余数(剩余定理)
- 有N个正实数(注意是实数,大小升序排列) x1 , x2 ... xN,另有一个实数M。 需要选出若干个x,使这几个x的和与 M 最接近。