我已覆蓋EditText,如this link中給出的。獲取提示屬性來自AttributeSet的值
現在同時宣佈內部佈局這一領域,我使用
<com.and.ab1209.ClearableEditText
android:id=」@+id/edit_text_clearable」
android:layout_width=」fill_parent」
android:hint="My Hint Goes here"
android:layout_height=」wrap_content」 />
如何取回內的任何這些構造的這個提示值。
public ClearableEditText(Context context, AttributeSet attrs, int defStyle){...}
public ClearableEditText(Context context, AttributeSet attrs){...}
我該怎麼做?
由於ClearableEditText擴展了RelativeLayout,我沒有getHint()方法可用。 –
比你應該創建自己的屬性和使用它 – Jin35
這是相當長的過程和更多的代碼,我不想跟隨,所以只有我問這個事情。 –