android 防止键盘弹出的简单方法

 

在最外层 或者 EditTextView的父布局中

添加

android:focusable="true"
android:focusableInTouchMode="true"

如下:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:layout_gravity="center_vertical">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:textSize="18dp"/>
</LinearLayout>

猜你喜欢

转载自blog.csdn.net/cyberHerman/article/details/81078381