(尚学堂)RecyclerView

RecyclerView 提供了一个插拔式的体验,高度的解耦,异常的灵魂,通过设置它提供的不同LayoutManager,ItemDecoration,ItemAnimator 实现令人瞠目的效果

设置分割线样式

在 styles.xml 样式文件中
<!--全局 线的效果 -->
 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
 <!-- Customize your theme here. -->
 <item name="colorPrimary">@color/colorPrimary</item>
 <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
 <item name="colorAccent">@color/colorAccent</item>
 <item name="android:listDivider">@drawable/divider_bg</item>
</style>
<!-- 独单使用. --> 
<style name="listDividerTheme" >
 <item name="android:listDivider">@drawable/divider_bg</item>
</style>

在 drawable 目录下的 divider_bg.xml
<?x

猜你喜欢

转载自blog.csdn.net/weixin_38107457/article/details/121411105
今日推荐