0
嗨我在我的程序部分禁用了edittext,但後來我想把它重新聯機,並且它不接受焦點或文本輸入。這裏是代碼android diasble EditText但無法恢復生命
禁用
intTextValue.setEnabled(false);
intTextValue.setInputType(InputType.TYPE_NULL);
intTextValue.setFocusable(false);
intSeek.setEnabled(false);
intType.setClickable(false);
啓用
intTextValue.setEnabled(true);
intTextValue.setInputType(InputType.TYPE_CLASS_NUMBER);
intTextValue.setFocusable(true);
intSeek.setEnabled(true);
intType.setClickable(true);
你會發現3的變量名有intTextValue是EditText上,intSeek是一個搜索欄和IntType上是一個微調,seekbar和微調都是查找,只是editText啓動啓用,禁用後不會重新啓用。
幫助將不勝感激。 謝謝。
這裏要禁用微調的點擊事件intType.setClickable(假); 。 – 2012-03-20 16:13:11
是'setInputType(NULL)'還是'setFocusable(false)'真的必要? – dldnh 2012-03-20 16:22:08
我確實在其他地方看過他們的說法,說實話我還沒有嘗試過,但人們談論過軟鍵盤和跟蹤球等問題。所以想要玩起來安全並且全部禁用。不要從主要問題分散注意力,禁用和重新啓用更多,那麼我真的需要不應該導致我認爲的問題? – Purplemonkey 2012-03-20 16:25:24