0
有一個列表適配器:ListView的高度(實際)
public class timetable_list_adapter extends BaseAdapter
{
...
}
和動態添加列表:
timetable_list_adapter adapter = new timetable_list_adapter(getApplicationContext(), eventList);
week_day_list.setAdapter(adapter);
列表元素是TableLayout
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_root_table"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="2">
在列表視圖的結果應用高度是錯的。 我試圖設定高度:
enter code hep = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT , ViewGroup.LayoutParams.MATCH_PARENT);
TableLayout tl = (TableLayout)findViewById(R.id.item_root_table);
p.height = 60 * eventList.size(); // INFO: change it after list_itemre
它的作品,但!在另一個屏幕上(比我的小)列表太大了。我該怎麼辦?
Java類和變量通常在CamelCase中定義。 timetable_list_adapter應該是TimetableListAdapter – Falmarri 2010-11-11 23:59:19