我想做一些這樣的事情。集中的項目水平ListView
在那裏,我有水平列表視圖。
<com.sample.HorizontalListView
android:id="@+id/hlist_collection_items"
android:layout_width="match_parent"
android:layout_height="@dimen/horizontal_list_collection_image_height"
android:background="#44aaaaaa"
android:divider="#44aaaaaa"
android:layout_gravity="bottom"
android:fadingEdgeLength="5dp"
custom:dividerWidth="2dp" />
我還需要做更多的事嗎?爲了使它集中的項目。 我的ListItem XML如下。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center" >
<ImageView
android:id="@+id/product_image_view_1"
android:layout_width="@dimen/horizontal_list_collection_item_image_height"
android:layout_height="@dimen/horizontal_list_collection_item_image_height"
android:layout_centerInParent="true"
android:gravity="center"
android:src="@drawable/loading_image"
android:scaleType="fitCenter" />
</LinearLayout>
我必須使它集中的項目。有項目左對齊。 – 2014-11-01 11:36:09
http://www.dev-smart.com/archives/34這可能有幫助 – 2014-11-01 11:37:18