設置EditText可輸入和不可輸入狀態

//設置EditText可輸入和不可輸入狀態
private void editTextable(EditText editText, boolean editable) {
if (!editable) { // disable editing password
editText.setFocusable(false);
editText.setFocusableInTouchMode(false); // user touches widget on phone with touch screen
editText.setClickable(false); // user navigates with wheel and selects widget
} else { // enable editing of password
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
editText.setClickable(true);
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章