android 设置EditText可输入和不可输入状态
生活随笔
收集整理的這篇文章主要介紹了
android 设置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);
}
}
總結
以上是生活随笔為你收集整理的android 设置EditText可输入和不可输入状态的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何做好公众号内容运营?这三个步骤就够了
- 下一篇: 从游戏中学习产品设计1:充值篇