好像可以在edittext控件中屏蔽掉

解决方案 »

  1.   

    import android.view.inputmethod.InputMethodManager;
     private InputMethodManager mIM;
     mIM = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    EditText ipNumber = (EditText) popupBody
    .findViewById(R.id.alertdialogedit);//ipNumber就是EditText
           handler.postDelayed(new Runnable() {
             public void run() {
              imm.hideSoftInputFromWindow(ipNumber.getWindowToken(), 0);          }
    }, 200);
    private Handler handler = new Handler() {
         public void handleMessage(Message msg) {
         switch (msg.what) {
         case 0:
         System.out.println("DONE");
         break;
         }
         }
        };
    这个我实现过,作用是启动的时候不弹出键盘,可以把这代码加到onCreate里面,但是必须延迟200毫秒以上,如果不加延迟发现没有效果。楼主试试看,实现肯定是没有问题的。有问题继续留意。
      

  2.   

    如果你是点击的时候不需要他,就加一个点击监听器,然后在onClick里面加imm.hideSoftInputFromWindow(ipNumber.getWindowToken(), 0);就可以了。
      

  3.   

    import android.view.inputmethod.InputMethodManager;
     private InputMethodManager mIM;
     mIM = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    EditText ipNumber = (EditText) popupBody
    .findViewById(R.id.alertdialogedit);//ipNumber就是EditText

    ipNumber.setOnClickListener(new OnClickListener(){ @Override
    public void onClick(DialogInterface arg0, int arg1) {
    imm.hideSoftInputFromWindow(ipNumber.getWindowToken(), 0);
    }

    })
    你也可以加focus改变的监听器setOnFocusChangeListener,这样焦点改变的时候就加隐藏的代码。
      

  4.   

    EditText.setInputType(InputType.TYPE_NULL);
      

  5.   

    AndroidManifest.xml   文件中Application 中加上android:windowSoftInputMode="adjustUnspecified"
      

  6.   

    让代码说话 O(∩_∩)O~在android的开发中,将整个页面只使用LinearLayout编辑时,当点击输入框时,系统自带的虚拟键盘会遮挡住输入框
    解决办法是在整个页面配置文件中,在LinearLayout布局外加入
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:orientation="vertical" android:layout_width="fill_parent" 
        android:layout_height="fill_parent" android:background="@drawable/backgroundshape">
    这样在系统自动调用虚拟键盘时,整个页面布局会发生变化,分为两个部分,一个是虚拟键盘显示的部分,一个是你自己的页面。