나는 목록보기를 가지고 있습니다. 각 행에 다음 필드를 표시하고 싶습니다.안드로이드의 ListView에서보기의 크기를 늘리십시오.
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). 이를 위해 listView에서 각 행의 크기를 늘려야합니다. 목록보기에서 행 크기를 늘리려면 어떻게해야합니까 ?? 도발을 좀하십시오 ....
시도 이미지를 요구 사항에 맞는 몇 가지 값으로 –
나는이 아이디어를 좋아하지 않는다. 다른 아이디어를 가지고 앞으로 나올 수 있습니까? –