Android ListView 分隔线每两行不同

标签 android xamarin android-view

所以我有一个 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>

我的 View 看起来像这样:

 <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 中我没有红色样式属性。

enter image description here

因此,当我运行 View 时,它显示如下,我的第 2、4 等...行比第 1 和第 2 元素之间的行更突出显示。

有什么想法吗?

最佳答案

这是模拟器的典型行为。在绘制线条或点等微小对象时,一些像素会丢失。

在真实设备上启动您的应用,它应该可以正常运行。

关于Android ListView 分隔线每两行不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42135153/

相关文章:

android - 改变启动 Activity

android - 如何制作难以逆向工程的安全签名APK?

android - 我是否需要 android 的任何特殊许可证书才能发布 android 应用程序?如何在 Release模式下签署 android 应用程序?

xamarin - 如何实现 INotifyPropertyChanged 以使 Xamarin 绑定(bind)更新?

c# - Xamarin 表格 : Image height request ignored inside frame inside relative layout

Android:使用 android.R.id.content 添加 fragment

Android Instrumentation 测试已取消但在设备上运行

Android - 如何将后续 View 发送回

android - 通过 id 查找列表项 Root View

c# - Xamarin.iOS 中 Swift 的 URL 结构的 C# 等效项是什么?