安卓popupwindow输入框无法输入问题
这两天在开发的时候要在页面中弹出一个ppopupwindow,里面就一个输入框。在genymotion模拟器中没有弹出输入法,但是可以通过电脑键盘输入
于是在网上查找了一些资料,试验之后发现都没有用。最终发现在popupwindow使用的布局xml中的edittext中加上一行代码解决问题,结果如上图所示。
我的edittext代码如下:
<EditText android:id="@+id/text_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/tv_edit" android:hint="名称" android:inputType="text" android:focusableInTouchMode="true" android:gravity="center" android:textSize="18sp" />最终解决问题的代码为:
android:focusableInTouchMode="true"