单击webview中的输入时未显示Android键盘

我在我的 Android应用程序中实现了自定义webview.如果我触摸此webview中的输入或文本区域,则软键盘不会显示.我没有在我的webview中覆盖任何touchlisteners,也没有在我的清单中更改任何内容.任何人都可以帮我弄清楚为什么键盘没有显示

我的布局代码

<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文件中的webview中.
android:focusable="true"
android:focusableInTouchMode="true"

希望能帮助到你.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...