這是我的佈局:滾動型不起作用
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollViewContact"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/contactOuterLayout"
>
<RelativeLayout
android:layout_height="fill_parent"
android:id="@+id/contactOuterRelativeLayout"
android:layout_width="fill_parent"
android:background="@drawable/radialback">
<RelativeLayout android:id="@+id/relativeLayout1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@+id/tableLayout1"
android:paddingBottom="10sp">
<TableLayout
android:id="@+id/contactdetails"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:stretchColumns="*" >
<TableRow
android:id="@+id/mapView"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
>
<LinearLayout
android:id="@+id/liny"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal"
android:weightSum="100">
<com.google.android.maps.MapView
android:id="@+id/map"
android:layout_height="100dp"
android:layout_width="100dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:enabled="true"
android:clickable="true"
android:apiKey="00n1pmS8eEhXhD5a6Q3UTDd6zortw9t4l_jXioQ"
/>
<TextView
android:id="@+id/MapAdrress"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:layout_weight="30"
android:text="TextView" />
</LinearLayout>
</TableRow>
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout android:id="@+id/contactinfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout android:id="@+id/contactinfo2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- Telephone number, web-site etc -->
</TableLayout>
</TableRow>
</TableLayout>
</TableRow>
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">
<TableLayout android:id="@+id/contactinfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
>
<Button
android:id="@+id/butonek"
android:layout_width="10dp"
android:layout_height="wrap_content"
/>
</TableLayout>
</TableRow>
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:paddingTop="20dip">
<TableLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal">
<TableLayout android:id="@+id/address"
android:layout_width="200dip"
android:layout_height="wrap_content">
<!-- Address -->
</TableLayout>
</TableRow>
</TableLayout>
</TableRow>
<TableRow android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:paddingTop="20dip">
<ListView
android:id="@+id/contactlist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="multipleChoice"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
這是圖片:
我對清單4組的元素,但我只能看到兩個不能滾動。我如何做到這一點,滾動所有頁面不僅列表?
但是當我在scrollView的外面放置listView時,一部分頁面會滾動,而listView有我們的滾動。我希望所有頁面都可以滾動。 – edi233
是的,我知道這真令人沮喪。您可以簡單地使用表格佈局併爲其添加動態視圖。它並不難做到。試着讓我知道。但這是唯一的方法,而不需要改變你的屏幕設計。 –
好的,我解決了我的問題,但其他方式。我的列表視圖放在線性佈局裏面,它完美的工作。 Thx尋求建議和幫助。 – edi233