2013-05-21 74 views
0

我裏面有一個滾動視圖鍵盤沒有出現與滾動視圖在web視圖Android的

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:background="@android:color/white" 
    android:orientation="vertical" 
    > 


    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/bg_header" 
     /> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     > 

     <WebView 
      android:id="@+id/webView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      /> 

    </ScrollView> 

</LinearLayout> 

網頁視圖,但它不會讓我點擊窗體字段或編輯框在web視圖一樣登錄字段等我把鍵盤

我試過刪除scrollView。也許是因爲一旦記錄的值是我做的webView「記住」這些字段,這就是爲什麼鍵盤沒有顯示?我怎樣才能解決這個

我應該怎麼做:(

+0

你有沒有在任何的Android設備上測試它,而不是模擬器。 –

+0

我在s2上工作....可能ScrollViw不會讓它變得焦點嗎?它開始時,我添加了scrollView,我無法刪除scrollView –

+0

這裏有什麼使用RelativeLayout .lol ..可以不使用textview或其他東西 – Unknown

回答

0

你能檢查這個嗎?從這裏讀取

http://developer.android.com/guide/topics/manifest/activity-element.html

android:windowSoftInputMode=["stateUnspecified", 
             "stateUnchanged", "stateHidden", 
             "stateAlwaysHidden", "stateVisible", 
             "stateAlwaysVisible", "adjustUnspecified", 
             "adjustResize", "adjustPan"] > 

android:configChanges="orientation|keyboard" 

試試這個

InputMethodManager imm = (InputMethodManager)this.getSystemService(Service.INPUT_METHOD_SERVICE); 

隱藏

imm.hideSoftInputFromWindow(ed.getWindowToken(), 0); 

以顯示

imm.showSoftInput(ed, 0); 
+0

當我點擊記住時出現錯誤。我不得不卸載應用程序,使其工作。如何CAn我修復這個 –

+0

張貼您的代碼.. – Unknown

1

在活動標籤Android清單,看到它你給這個

android:configChanges="orientation|keyboard" 

您的代碼可能有

android:configChanges="orientation|keyboardHidden" 

檢查出來,並讓我知道。

+0

沒有工作,我沒有隱藏鍵盤,但我添加了上面一個。當我添加scrollView時,問題開始,我無法刪除scrollView,否則WebView將不會顯示其內容 –

相關問題