您的位置:首页 > 其它

RecyclerView简单使用之自定义RecyclerView分割线

2016-11-08 15:47 411 查看
1,在自己的项目drawable下面创建shapeb这么一个文件

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"

android:shape="rectangle"
>
<size android:height="4dp"></size>
<gradient
android:startColor="#ffff0000"
android:centerColor="#ff00ff00"
android:endColor="#ff0000ff"
android:type="linear"></gradient>
</shape>


2,在项目的styles.xml文件中引用

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->

<item name="android:listDivider">@drawable/shapeb</item>
</style>

</resources>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息