0
我想使用drawableRight
的EditText
作爲某些東西的定位視圖。
但是沒有任何方法可以獲得drawableRight
。使用EditText的drawableRight作爲定位點
有沒有辦法做到這一點?
我想使用drawableRight
的EditText
作爲某些東西的定位視圖。
但是沒有任何方法可以獲得drawableRight
。使用EditText的drawableRight作爲定位點
有沒有辦法做到這一點?
編程:
edt.setCompoundDrawablesRelativeWithIntrinsicBounds(0, R.drawable.ic_right, 0, 0);
edt.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(android.R.drawable.ic_right), null);
XML:
android:drawableRight="@drawable/ic_right"
'editText.getCompoundDrawables()[2]'獲取當前右繪製。 –