android: EditTextView不自动获取焦点

android:focusable="true"

android:focusableInTouchMode="true"

在网上能找到这个 , 在父控件添加这个 

或者是 

    public static void hideSoftInputFromWindow(Activity activity) {
        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
        }
    }

但是在 scroview 中 , 这些都没有用 , 在这里面还要对 edittext 添加 

android:focusableInTouchMode="true"

亲自测试了这样才有效 


版权声明:本文为qq_26500807原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。