1. 程式人生 > >控制drawableLeft等的可見性

控制drawableLeft等的可見性

不能去掉紅字部分,否則不顯示drawable mBottom = getResources().getDrawable(R.drawable.rcs_search_edittext); mBottom.setBounds( 0, 0, mBottom.getMinimumWidth(),mBottom.getMinimumHeight()); mLeft = getResources().getDrawable(R.drawable.ic_actionbar_search_normal); mLeft.setBounds( 0, 0, mLeft.getMinimumWidth(),mLeft.getMinimumHeight()); 左可見: mEditSearchText.setCompoundDrawables(mLeft,null,null,mBottom); 左不可見只需要設定null
mEditSearchText.setCompoundDrawables(null,null,null,mBottom);