包含EditText组件的界面中,禁止自动弹出软键盘

解决方法:
1)在Manifest.xml文件中相应的activity下添加一下代码:
android:windowSoftInputMode="stateHidden"

2)让EditText失去焦点,使用EditText的clearFocus方法 
例如:EditText edit=(EditText)findViewById(R.id.edit); 
           edit.clearFocus(); 

3)强制隐藏Android输入法窗口 
例如:EditText edit=(EditText)findViewById(R.id.edit);  
           InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
           imm.hideSoftInputFromWindow(edit.getWindowToken(),0); 

4).EditText始终不弹出软件键盘 
例:EditText edit=(EditText)findViewById(R.id.edit); 
       edit.setInputType(InputType.TYPE_NULL);

android edittext不自动获取光标

  1. <LinearLayout   
  2.                 android:focusable="true"   
  3.                 android:focusableInTouchMode="true"  
  4.                 android:layout_height="0px"   
  5.                 android:layout_width="0px"  
  6.                 /> 

你可能感兴趣的:(包含EditText组件的界面中,禁止自动弹出软键盘)