srb*_*990 2 android android-linearlayout
我试图禁用线性布局内的所有字段.线性布局中有许多edittext和textview.但是,我只是试图禁用edittext.我能够禁用所有孩子,但我希望能够禁用编辑文本.有没有办法做到这一点?
ll你的线性布局在哪里:
LinearLayout ll = (LinearLayout) findViewById(R.id.myLLid);
for (View view : ll.getTouchables()){
if (view instanceof EditText){
EditText editText = (EditText) view;
editText.setEnabled(false);
editText.setFocusable(false);
editText.setFocusableInTouchMode(false);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1368 次 |
| 最近记录: |