我在我的android应用中实现了自定义的webview。如果我触摸此Web视图内的输入或文本区域,则不会显示软键盘。我没有在Web视图中覆盖任何触摸侦听器,也没有更改清单中的任何内容。谁能帮我弄清楚为什么键盘不显示?
我的布局代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<nl.AEGEE.enschede.android.AEGEEWebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:progressTint="@color/aegee_blue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-6dp"
android:layout_alignParentTop="true" />
</RelativeLayout>
请尝试将这些行添加到XML文件中的Web视图中。
android:focusable="true"
android:focusableInTouchMode="true"
希望能帮助到你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句