iam*_*koa 13 xml android listview android-layout android-listview
我设法通过在/ app/res/drawable /文件夹中创建名为dash.xml的文件来弄清楚如何创建自定义形状(使用虚线笔划):
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#534b4b"
android:width="1dp"
android:dashGap="2dp"
android:dashWidth="1dp"
/>
<size
android:height="1dp"
/>
</shape>
Run Code Online (Sandbox Code Playgroud)
现在我对如何将这个形状应用于ListView感到困惑.我尝试了以下内容,但没有显示分隔符:
<ListView android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:divider="@drawable/dash"
android:dividerHeight="1dp"
/>
Run Code Online (Sandbox Code Playgroud)
跆拳道?
小智 34
这是我的,它的工作原理:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#FF404040"
android:width="1dp"
android:dashGap="3dp"
android:dashWidth="1dp"
/>
<size
android:height="3dp"
/>
</shape>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11520 次 |
最近记录: |