其实有一个大家一直没有注意发现的问题就是Button是继承与TextView,是TextView衍生出来的,自然就有些方法就可以调用。
下面这两个方法就是本文的重点:
context.getDrawable(left)
setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom)
项目中的tab下的几个可切换的按钮效果图:
其实有一个大家一直没有注意发现的问题就是Button是继承与TextView,是TextView衍生出来的,自然就有些方法就可以调用。
下面这两个方法就是本文的重点:
context.getDrawable(left)
setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom)
项目中的tab下的几个可切换的按钮效果图: