Android StickyListHeadersListView头部悬停 分组列表实现

本文介绍了如何使用StickyListHeaders库在Android中创建具有头部悬停效果的分组列表。通过引用库、定义子布局、适配器和活动布局,实现了分组列表的动态展示,并提供了实际运行效果截图。
摘要由CSDN通过智能技术生成

最近在做分组列表,头部悬停的效果,在github上就搜到了StickyListHeaders(https://github.com/emilsjolander/StickyListHeaders)这个库,自己动手实现了一个demo,实际效果图见文末。

引用类库:

implementation 'se.emilsjolander:stickylistheaders:2.7.0'

子布局item_pay_bill_month_body_list.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/item_body_tv1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:text="内容"
        android:textSize="20sp" />

    <TextView
        android:id="@+id/item_body_tv2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:text="内容"
        android:textSize="20sp" />

    <TextView
        android:id="@+id/item_body_tv3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:text="内容"
        android:textSize="20sp" />

    <TextView
        android:id="@+id/item_body_tv4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:text="内容"
        android:textSize="20sp" />

    <TextView
        android:id="@+id/item_body_tv5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值