开发者

how to disable EditText

I am writing an app which requires at a time the EditText view to be uneditable. I used editText.setEna开发者_运维百科bled(false); it is greyed out alright, but the IME still pops up, and I still could type in characters, why could this be???


            if (cbProhibitEditPW.isChecked()) { // disable editing password
                editTextPassword.setFocusable(false);
                editTextPassword.setFocusableInTouchMode(false); // user touches widget on phone with touch screen
                editTextPassword.setClickable(false); // user navigates with wheel and selects widget
                isProhibitEditPassword= true;
            }
            else { // enable editing of password
                editTextPassword.setFocusable(true);
                editTextPassword.setFocusableInTouchMode(true);
                editTextPassword.setClickable(true);
                isProhibitEditPassword= false;
            }  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜