Android 代码中设置drawableleft 改变,隐藏。

  1. Drawable drawable= getResources().getDrawable(R.drawable.drawable);  
  2. /// 这一步必须要做,否则不会显示.  
  3. drawable.setBounds(00, drawable.getMinimumWidth(), drawable.getMinimumHeight());  
  4. myTextview.setCompoundDrawables(drawable,null,null,null);  
  5.   
  6.   
  7. //隐藏Drawables  
  8. myTextview.setCompoundDrawables(null,null,null,null);  

转载连接:https://blog.csdn.net/yujunlong3919/article/details/19923753

猜你喜欢

转载自blog.csdn.net/yijiaodingqiankun/article/details/80310454