【发布时间】:2012-04-13 06:30:19
【问题描述】:
我正在编写一个 Android 应用程序来显示一个论坛。
主文的内容在WebView,我想把答案放到主文下的ListView。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:orientation="vertical" >
<WebView
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
//android:layout_weight="1.0"
android:background="@drawable/bg"
android:cacheColorHint="#00000000"
android:textColor="#FFDEC2" />
<ListView
android:id="@+id/contentlist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
这里根本不显示ListView。如果我启用
android:layout_weight="1.0"
屏幕被分割,两者都显示了,但ListView 应该在WebView 之下,因此两者只有一个滚动条。
我认为这篇文章:Android layout - listview and edittext below 是关于我的问题,但我不明白如何编辑此 site 的代码以适应我的问题。
谁能帮帮我?
【问题讨论】:
-
您不能在滚动视图中使用列表视图,反之亦然。
标签: android listview layout webview forum