AndroidでListViewの要素の高さを固定したいときの要点だけ

AndroidのListViewで、要素(行)の高さを固定したいとき。
例えば行がLinearLayoutだとして、

<LinearLayout
  xmlns:android=“http://schemas.android.com/apk/res/android”
  android:layout_width=“fill_parent” android:layout_height=“100dp”>
<!– SOME UI –></LinearLayout>

みたいなheightの設定だけでは不十分で、

<LinearLayout
  xmlns:android=“http://schemas.android.com/apk/res/android”
  android:layout_width=“fill_parent” android:layout_height=“100dp” 
  android:minHeight=“100dp”>
<!– SOME UI –></LinearLayout>

みたいにminHeight(最小の高さ)も設定する必要がある。

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA