2011-07-27 29 views
0

我有內部網頁視圖列表視圖。所以我創建了一個自定義列表視圖。 WebView禁止我點擊,所以我創建了一個webviewclicklistener。問題與自定義列表視圖的(的WebView在我的列表視圖),我有一個問題,讓我瘋了</p> <p>顯示

我的問題是,當我顯示一些圖像,我的webviews是「搖動」,就好像它想要加載圖像一千次。事實上,我發現一些元素的高度尺寸像每秒鐘一樣變化,這給人一種震動的感覺。

我發現修復它的唯一方法是爲我的列表視圖提供佈局:height值。 我的新問題是,當我舉例600dip,我有一個滾動條,但我不能看我的列表視圖的結尾。 如果我像1000dip一樣,我沒有滾動條,我也看不到我的列表結束。

這裏是我的佈局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
android:orientation="vertical" android:background="@drawable/woodbackground" 
android:layout_weight="1"> 
<TextView android:background="@android:color/transparent" 
    android:layout_width="fill_parent" android:layout_height="wrap_content" 
    android:hint="Question" android:textSize="30px"></TextView> 
<ScrollView android:layout_width="fill_parent" 
    android:layout_height="wrap_content" android:orientation="vertical"> 
    <WebView android:id="@+id/wvplquestion" android:layout_height="wrap_content" 
     android:layout_width="fill_parent"></WebView> 
</ScrollView> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:background="@android:color/transparent" android:layout_width="fill_parent" 
    android:layout_height="wrap_content" android:orientation="vertical" 
    android:layout_weight="1"> 
    <TextView android:background="@android:color/transparent" 
     android:layout_width="fill_parent" android:layout_height="wrap_content" 
     android:hint="Select Answer" android:textSize="30px"></TextView> 
    <ListView android:id="@+id/lvquestion" android:layout_width="fill_parent" 
     android:layout_height="600dip" android:prompt="@string/selectp" /> 
</LinearLayout> 

而我的列表視圖定製佈局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" android:layout_height="wrap_content" 
android:orientation="vertical" android:padding="3dip"> 
<WebView android:id="@+id/weblistview" android:layout_width="fill_parent" 
    android:layout_height="wrap_content"></WebView> 

感謝您的幫助

回答

0

也許你可以試試ŧ o改變你的列表視圖佈局高度。而不是包裝內容,把一個固定的高度。我不知道它是否會起作用,但你可以嘗試。我會遇到類似於你的問題,並且我解決了這個問題。 我希望它能起作用。祝你好運;)

+0

是的,這就是我所做的。這不是最好的解決方案,因爲我有各種內容,但沒關係 – joris

0

似乎它主要發生在幾個webviews包含在一個滾動視圖。似乎至少第一個網頁瀏覽應該有固定的高度。