2016-01-05 32 views
6

私のAndroid搭載アプリケーションにカスタムWebviewが実装されています。このWebviewの内部の入力領域やテキスト領域に触れると、ソフトキーボードが表示されません。私は私のwebviewでtouchlistenersをオーバーライドしていないし、私はマニフェストで何かを変更しませんでした。誰も私はなぜキーボードが表示されないのか理解できますか?webviewで入力をクリックしたときにAndroidキーボードが表示されない

マイレイアウトコード:

<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> 

答えて

7

XMLファイルであなたのWebViewにこれらの行を追加してみてください。

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

希望します。

+0

ありがとうございました!奇妙なことは、WebViewをコード内で拡張し、customwebviewなしですべてが期待どおりに機能することです。 – Victor

+0

あなたは歓迎です、ハッピーコーディング:) – Kristo

関連する問題