リストに関する仮定 (更新):
10 個を超えるリスト要素は含まれません(リスト要素は以下の xml レイアウトによって定義されます)。
- リスト要素には最大20 個の子ビュー
LinearLayout
を持つことができる が含まれているため、すべての要素の高さは不明です(以下の xml を参照)。
リスト要素の XML レイアウト:
<?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:orientation:"horizontal">
<!--
This LinearLayout is going to contain one or more
Views which will be added progammatically on runtime.
The number of children views added to it depend on the
data to be displayed, and the only assumption that can
be made is that there's will be no more than 20 child
views for one particular instance of this LinearLayout.
-->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="25dp"/>
<ImageButton
android:layout_width="25dip"
android:layout_height="25dip"
android:layout_gravity="center|top"
android:layout_marginLeft="-25dp"/>
</LinearLayout>
質問:
ListView
(上記のような) 構造に自由度があり、
渡された convertView を引き続き使用できるレイアウトに を使用することは意味がありListView#getView(...)
ますか?
LinearLayout
別の方法として、すべてのリスト要素をアウターに入れ、これを の中に入れるのは間違っていScrollView
ますか? これを行うと、 のキャッシュ機能は得られListView
ませんが、リストに関する仮定を考えると、それほど重くはないのではないでしょうか? (上を参照)。(この代替のルックアンドフィールを のようにする方法についての指針はありListView
ますか?標準の色とセレクターなどを適用することを考えています。)