2013-05-08 248 views
3

設置分頻器有可能使水平列表視圖項之間的空間?
我嘗試一下本作的ListView。
android:divider="#ffff00" android:dividerHeight="10dp"的水平列表視圖

它在listview中工作正常。但我想在水平Listview項目之間添加分隔線。如何糾正這個問題?分享你的想法?

+0

是你的定製,使用手段baseadapter? – UnderGround 2013-05-08 10:27:24

+0

http://stackoverflow.com/questions/4984313/spacing-between-listview-items-android – 2013-05-08 10:27:37

+0

http://stackoverflow.com/questions/9160239/how-to-put-padding-spacing-in-between-list - 視圖項和滾動條功能的Android – 2013-05-08 10:27:55

回答

0

設置邊框的xml文件列表項或添加自定義視圖如下:

<View 
    android:layout_height="match_parent" 
    android:width="1dp" 
    android:background="#ffff00" 
/> 
+0

我有邊界爲我listitem.i想擁有列表項 – user2342047 2013-05-08 10:31:44

0

你在Android的水平列表視圖中是什麼意思?

如果自定義列表,然後添加視圖速滑運動員的肌肉兩項並設置視圖的backgroundColor。

0

所有尊重@Mhhir Shah,更新他的答案以符合您的要求。

在你的列表項集邊境XML文件或添加自定義視圖如下:

<View 
    android:layout_height="match_parent" 
    android:width="1dp" 
    android:background="@android:color/transparent" 
/> 

這將提供您所需要的空間。

+0

您可以使用RecyclerView類來實現水平ListView和使用填充之間的一些空間,從這個帖子顯示HTTP ://whats-online.info/science-and-tutorials/87/Android-tutorial-Horizo​​ntal-RecyclerView-with-images-and-text-example/ – 2016-12-04 01:13:11