相关疑难解决方法(0)

Android ListView Divider

我有这个代码:

<ListView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:id="@+id/cashItemsList"
     android:cacheColorHint="#00000000"
     android:divider="@drawable/list_divider"></ListView>
Run Code Online (Sandbox Code Playgroud)

在哪里@drawable/list_divider:

<shape
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line">
 <stroke
   android:width="1dp"
   android:color="#8F8F8F"
   android:dashWidth="1dp"
   android:dashGap="1dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)

但我看不到任何分隔线.

android listview divider

97
推荐指数
7
解决办法
17万
查看次数

填充不会影响XML布局中的<shape>

我试图<shape>在XML文件/布局中声明填充.但无论我设置什么,没有任何与填充相关的变化.如果我修改任何其他属性,我会在UI上看到效果.但它不适用于填充.你能否就可能出现这种情况的原因提出建议?

这是我试图设计的XML Shape:

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

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

    <solid android:color="@color/button_white_cover"/>

    <corners android:radius="11dp"/>

    <padding android:left="1dp" 
             android:top="20dp"
             android:right="20dp" 
             android:bottom="2dp"/>
 </shape>
Run Code Online (Sandbox Code Playgroud)

user-interface android

72
推荐指数
5
解决办法
7万
查看次数

自定义样式listdivider

我正在尝试将默认的ListView列表分隔符设置为在两边都有空白边距.我已经尝试设置整个ListView的边距,但是没有创建所需的结果.

是)我有的:

是)我有的

我想要做什么(注意分隔线两侧的边距):

我需要拥有什么

这样做的最佳方式是什么?提前致谢!

android android-layout android-listview

5
推荐指数
2
解决办法
2万
查看次数