リスト View があります。各行に次のフィールドを表示したい。
1. An Image
2. An TextView For Book Name
3. An TextView For Author Name
4. An TextView For File Type
すべてのことは、私によって成功裏に行われました。しかし、リスト ビューの各行のサイズは、画像で説明されているように、このすべての機能を表示するには十分ではありません。
これを作成するためのコード:
if( row_view == null)
{
LayoutInflater inflater = context.getLayoutInflater();
row_view = inflater.inflate(R.layout.row_layout, null,true) ;
holder = new ViewHolder();
holder.textView_for_BookName = (TextView) row_view.findViewById(R.id.book_text_view_book_tab);
holder.textView_For_fileType = (TextView) row_view.findViewById(R.id.type_for_book_tab);
holder.textView_Forauthor = (TextView) row_view.findViewById(R.id.author_text_view_book_tab);
holder.imageview = (ImageView) row_view.findViewById(R.id.image_sd_list_view);
row_view.setTag(holder);
}
rowLayout.xml のコードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="horizontal">
<ImageView
android:src="@drawable/icon"
android:layout_width="wrap_content"
android:id="@+id/image_sd_list_view"
android:layout_height="wrap_content">
</ImageView>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:textColor="#000000"
android:textSize="20dip"
android:paddingLeft="10dip"
android:text="Book Name"
android:id="@+id/book_text_view_book_tab">
</TextView>
<TextView
android:id="@+id/author_text_view_book_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Author Name"
android:textColor="#000000"
android:textSize="13dip"
android:layout_marginLeft="15dip">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="File Type :"
android:textColor="#000000"
android:layout_marginLeft="15dip"
android:textSize="10dip"
android:id="@+id/type_for_book_tab">
</TextView>
</LinearLayout>
</LinearLayout>
上記のフィールド (book_name,author_name,file_type) を各 textView に表示したいと思います。そのためには、listView の各行のサイズを大きくする必要があります。リスト ビューの行のサイズを大きくするにはどうすればよいですか?? 助けてください....