私は、ListView
すべてのアイテムにテキスト フィールドのみが含まれ、他には何も含まれていない単純なものを使用しています。リスト項目の xml コードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:background="@drawable/bg_card">
<TextView
android:id="@+id/txt"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:textSize="15sp"
android:paddingLeft="6dip"
android:textColor="#878787"
android:textIsSelectable="true"/>
</LinearLayout>
</FrameLayout>
リストビューを使用したフラグメントのレイアウトは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e5e5e5">
<ListView
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:dividerHeight="0dp"
android:divider="@null"/>
</RelativeLayout>
さて、このように私のフラグメントにアダプターのオブジェクトを作成しながら
Level weather_data[] = new Level[] {
new Level(R.drawable.s1,
"Some text which will be present in the list item",
R.drawable.play_button)
};
2 番目のパラメーター、つまりテキストに非常に長い文がある場合、その一部が表示されず、リスト項目に文が不完全に表示されます。
リスト項目の高さを変更しようとしandroid:minHeight
ましたが、うまくいきませんでした。これに対する解決策は何ですか?ありがとう