在最外层 或者 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>