在Android 中,TextView 是继承于View,而Button是继承于TextView.这个有一个API就可以实现的。

android:drawableBottom setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) The drawable to be drawn below the text.
android:drawableLeft setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) The drawable to be drawn to the left of the text.
android:drawablePadding setCompoundDrawablePadding(int) The padding between the drawables and the text.
android:drawableRight setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) The drawable to be drawn to the right of the text.
android:drawableTop setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) The drawable to be drawn above the text.

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. python list.sort()根据多个关键字排序的方法实现
  3. Android(安卓)商显会议平板聚光灯效果实现
  4. Android实现圆角弹框功能
  5. 美图秀秀自由拼图android实现
  6. android:实现双击事件(DoubleClick)
  7. android实现好看的自定义提示框
  8. Android(安卓)实现Xmpp工具类
  9. Android(安卓)通知Notification的两种实现方法

随机推荐

  1. AndroidManifest 中original-package标签
  2. Android中app的请求抓包工具 Fiddler 详
  3. android关于activity的组成
  4. android电源管理之框架分析
  5. Android体系结构分析
  6. [置顶] Android(安卓)启动 白屏问题 解决
  7. Android解析WindowManagerService(一)WMS的
  8. Android省市区3级联动的地址列表的实现
  9. Android自带音频均衡器MusicFx分析
  10. Android使用SAX解析XML(1)