android - 在 ListView 中突出显示行的边框

标签 android android-listview

<分区>

我有一个可滚动的 ListView 。我需要像这样突出显示行的顶部和底部边框 () .作为新手告诉我如何做到这一点。提前致谢

最佳答案

android:listSelector="@drawable/list_selectorcolor"

在drawable中这样创建

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <gradient
        android:angle="90"
        android:endColor="#000000"
        android:startColor="#000000"
        android:type="linear"/>

    <stroke
        android:width="1dp"
        android:color="#800080"
        android:dashWidth="2dp"/>    

</shape>

关于android - 在 ListView 中突出显示行的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18669962/

相关文章:

java - adapter.add(event) 抛出 java.lang.UnsupportedOperationException

java - 根据位置在ListView中膨胀自定义View

java - Android ListView 未调用适配器的类 getView() 函数

android - Firebase API key 限制不适用于 Android 应用程序包名称和 SHA1 指纹

java - 安卓 : want to access to a textview in a viewholder in my mainactivity

java - 改造 2 和 GSON java.lang.IllegalArgumentException : Field map contained null value for key

android - Path.reset 与 Path.rewind

android - 如何在 Android ListView 中显示空列表

android - 刷新 fragment android

java - 如何检查 ImageView 是否加载了来自 URL 的图片