各位大大好:
小妹寫了一個arraylist
想要透過listview將位於這個arraylist中的值顯示出來
(其中,listview包在TableLayout中)
想要請問一下 這要如何實現呢?ˊˋ
我的xml如下:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"><LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<!-- android:text="@string/city_prompt" 提示信息 -->
<!-- android:entries="@array/city_labels" 下拉列表內容 -->
<!-- 第一層 -->
<Spinner
android:id="@+id/city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/city_labels"
android:text="@string/city_prompt" />
<!-- 第二層 -->
<Spinner
android:id="@+id/zip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/area_prompt" />
<TableLayout
android:id="@+id/user_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dip"
android:background="#ffcccccc"
android:stretchColumns="*" >
</TableLayout>
<TableRow
android:clickable="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffcc99"
android:layout_margin="3dip">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
</TableRow>
</LinearLayout>
</ScrollView>
小妹寫了一個arraylist
想要透過listview將位於這個arraylist中的值顯示出來
(其中,listview包在TableLayout中)
想要請問一下 這要如何實現呢?ˊˋ
我的xml如下:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"><LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<!-- android:text="@string/city_prompt" 提示信息 -->
<!-- android:entries="@array/city_labels" 下拉列表內容 -->
<!-- 第一層 -->
<Spinner
android:id="@+id/city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/city_labels"
android:text="@string/city_prompt" />
<!-- 第二層 -->
<Spinner
android:id="@+id/zip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/area_prompt" />
<TableLayout
android:id="@+id/user_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dip"
android:background="#ffcccccc"
android:stretchColumns="*" >
</TableLayout>
<TableRow
android:clickable="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffcc99"
android:layout_margin="3dip">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
</TableRow>
</LinearLayout>
</ScrollView>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货