0
我有一個從EditText擴展的自定義EditText。當用戶將其設置爲自定義EditText時,我想獲取默認的attr android:selectAllOnFocus
。在自定義視圖中獲取默認的Android attr
我在構造函數中
boolean selecteAllOnFocus = false;
selectAllOnFocus = attrs.getAttributeBooleanValue("android", "selectAllOnFocus", selectAllOnFocus);
下面的代碼它是沒有得到的值。有什麼我想念的嗎?
有你完整的URL /路徑命名空間試過嗎?就像這個'http:// schemas.android.com/apk/res/android'。 – Drez
是的,它在xml中有alrady ...'xmlns:android =「http://schemas.android.com/apk/res/android」' – Elye