[英]Android ListView divider different for every second row
所以我有一個divider.xml
<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/red"/>
</shape>
我的視圖如下所示:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Mvx.MvxListView
android:id="@+id/suppliersListView"
android:divider="@drawable/divider"
android:scrollbars="vertical"
android:choiceMode="singleChoice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left|start"
local:MvxItemTemplate="@layout/item_supplier"
local:MvxBind="ItemsSource ReceptionSuppliersList; ItemClick ReceptionBasicInformationSelectCommand"/>
</LinearLayout>
在@ layout / item_supplier中,我沒有紅色的樣式屬性。
因此,當我運行視圖時,這樣顯示,第二,第四等行比第一和第二元素之間的行更加突出。
有什么想法嗎?
這是仿真器的典型行為。 在繪制線條或點之類的微小物體時,一些像素會丟失。
在真實設備上啟動您的應用,它應該可以正常運行。
在Listview
添加以下屬性,並在android:divider
使用您喜歡的顏色,然后在android:cacheColorHint
放入透明顏色,如下所示:
android:divider="#00000000"
android:cacheColorHint="#00000000"
android:fadingEdge="none"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.