textview中有一个属性android:drawableLeft="@drawable/icon",上下左右都可以添加图片,在代码中可动态改变中的代码为Drawable drawable = getResources().getDrawable(R.drawable.spinner_checked);

drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); //设置边界

titleTv.setCompoundDrawables(null, null, drawable, null);//画在右边

setCompoundDrawables(null, null, drawable, null),这四个参数指的是那个位置(左上右下)

 

更多相关文章

  1. android EditText设置不可写
  2. android 使用html5作布局文件: webview跟javascript交互
  3. android studio调试c/c++代码
  4. IM-A820L限制GSM,WCDMA上网的原理(其他泛泰机型可参考)7.13
  5. 锁屏界面
  6. android(NDK+JNI)---Eclipse+CDT+gdb调试android ndk程序
  7. Android(安卓)version and Linux Kernel version
  8. Android(安卓)闹钟管理类的使用
  9. Android学习篇之Menu的使用

随机推荐

  1. k8s ingress配置转发tcp流量
  2. 好用到飞起的12个jupyter lab插件
  3. Python安装第三方库太慢?配置好这个速度飞
  4. Jupyter Notebook最常用的五大配置技巧
  5. 对SVG动画进行异步懒光栅化处理 [每日前
  6. 基于geopandas的空间数据分析——空间计
  7. 怎样在服务器上启用 HTTPS [每日前端夜话
  8. matplotlib绘图的核心原理讲解
  9. matplotlib绘图技巧详解(一)
  10. 异步函数中的异常处理及测试方法 [每日前