2016-01-05 37 views
6

Tôi có chế độ xem web tùy chỉnh được triển khai trong ứng dụng Android của mình. Nếu tôi chạm vào đầu vào hoặc vùng văn bản bên trong webview này, bàn phím mềm sẽ không hiển thị. Tôi đã không ghi đè bất kỳ touchlisteners trong webview của tôi cũng không làm tôi thay đổi bất cứ điều gì trong biểu hiện của tôi. Bất cứ ai có thể giúp tôi tìm ra lý do tại sao bàn phím không hiển thị?Bàn phím Android không hiển thị khi nhấp vào đầu vào trong chế độ xem web

mã bố trí của tôi:

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

Trả lời

7

hãy cố gắng thêm những dòng này để webview của bạn trong file XML.

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

Hy vọng điều đó sẽ hữu ích.

+0

Cảm ơn bạn rất nhiều, đó là tất cả! Điều kỳ lạ là tôi mở rộng một WebView trong mã của tôi và không có customwebview mọi thứ hoạt động như mong đợi. – Victor

+0

Bạn được chào đón, Happy coding :) – Kristo

Các vấn đề liên quan