我是知道的设置drawableRight XML格式。但我需要做programetically,因为它是改变按一定的条件。
I know about set drawableRight in XML. but i required to do it programetically because it is change as per some condition.
您可以使用下面的功能:
You can use the function below:
editText.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.drawableRight, 0);
相应的绘制位置PARAMS的顺序是:左,上,右,下
The order of params corresponding to the drawable location is: left, top, right, bottom