我想做一些这样的事情。集中的项目水平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