2012-06-07 3 views
0

simple_list_item1은 안드로이드에서 ListView를 만드는 데 사용된다는 것을 알고 있습니다. simple_list_item2 란 무엇입니까? 또한 ListView의 전체 모양을 어떻게 변경합니까?Android 개발 : simple_list_item1과 simple_list_item2의 차이점은 무엇입니까?

예제 코드 : ListView lv; lv.setAdapter (새 ArrayAdapter (this 및 android.R.layout.simple_list_item_1, results));

+0

검사에 사용이 인이 : HTTP : //www.davekb.com/browse_programming_tips : android_simple_list_item1_and_simple_list_item2 : txt – GAMA

답변

1

simple_list_item2 한 LineListItem 수단은

<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:minHeight="?android:attr/listPreferredItemHeightSmall" /> 

simple_list_item2이 TwoLineListItem 수단은 2 TextViews을 가지고있다 하나의 텍스트 뷰 ......

<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" android:mode="twoLine"> 

     <TextView android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft" android:layout_marginTop="8dip" android:textAppearance="?android:attr/textAppearanceListItem" /> 

     <TextView android:id="@android:id/text2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@android:id/text1" android:layout_alignLeft="@android:id/text1" android:textAppearance="?android:attr/textAppearanceSmall" /> 


</TwoLineListItem> 

http://mylifewithandroid.blogspot.in/2008/03/my-first-meeting-with-simpleadapter.html

관련 문제