问题列表视图定制的显示(的WebView在我的列表视图) [英] Problem with the display of custom listview (webview in my listview)
问题描述
我有一个问题,让我疯了。
I am having an issue that make me crazy
我有内部网页视图列表视图。因此,我创建一个自定义列表视图。
web视图禁止我这样点击我创建了一个webviewclicklistener。
I have a listview with WebView inside. So I created a custom listview. The WebView forbid me to click so I created a webviewclicklistener.
我的问题是,当我展示一些图片,我的网页视图是惊天,如果它要加载图像一千倍。
事实上,我发现某些元素的高度尺寸改变每秒,让晃动的感觉等。
My problem was that when I display some images, my webviews are "shaking" as if it wants to load the image a thousand times. In fact I discovered that the height size of some elements change like every seconds, that give a feeling of shake.
我找到解决它的唯一方法是给一个布局:为我的ListView高度值。
我的新问题是,当我把对为例600dip,我有一个滚动条,但我不能看我的列表视图的结尾。
如果我把喜欢1000dip,我没有滚动条,我不能看到我的列表的末尾也没有。
The only way I found to fix it is to give a layout:height value for my listview. My new problem is that when I put for exemple 600dip, I have a scrollbar, but I can't look at the end of my listviews. If I put like 1000dip, I don't have scroll bar and I can't see the end of my list neither.
下面是我的布局
<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>
和我的自定义列表视图布局
And my custom listview layout
<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>
感谢您的帮助。
推荐答案
也许你可以试着改变你的列表视图布局高度。相反的包裹内容,把一个固定的高度。我不知道这是否会工作,但你可以试试。我倒是类似你这样的问题,我解决了这个样子。
我希望它会工作。祝你好运;)
maybe you can try to change your listview layout height. Instead of wrap content, put a fixed height. I don't know if it will be working, but you can try it. I'd a problem similar to yours and I solved it like this. I hope it will work. Good luck ;)
这篇关于问题列表视图定制的显示(的WebView在我的列表视图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!