当前位置: 首页 > article >正文

页面布局实现-左侧横向滑动展示隐藏数据,右侧固定展示操作按钮。可上下滑动联动

效果图

1.布局排版

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="1dp">

    <LinearLayout
        android:id="@+id/lltList"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <HorizontalScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:fillViewport="true"
            android:overScrollMode="never"
            android:scrollbars="none">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:id="@+id/lltTopLeft"
                    android:layout_width="match_parent"
                    android:layout_height="24dp"
                    android:background="#E7ECF2"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:paddingHorizontal="7dp">

                    <TextView
                        android:layout_width="110dp"
                        android:layout_height="wrap_content"
                        android:text="测试1"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />


                    <TextView
                        android:layout_width="90dp"
                        android:layout_height="wrap_content"
                        android:drawablePadding="4dp"
                        android:text="测试2"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />


                    <TextView
                        android:layout_width="100dp"
                        android:layout_height="wrap_content"
                        android:drawablePadding="4dp"
                        android:text="测试测试3"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="80dp"
                        android:layout_height="wrap_content"
                        android:drawablePadding="4dp"
                        android:text="测试4"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="60dp"
                        android:layout_height="wrap_content"
                        android:text="测试5"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />


                    <TextView
                        android:layout_width="60dp"
                        android:layout_height="wrap_content"
                        android:text="测试6"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />


                    <TextView
                        android:layout_width="100dp"
                        android:layout_height="wrap_content"
                        android:text="测试7"
                        android:textColor="#333333"
                        android:textSize="10sp"
                        android:textStyle="bold" />

                </LinearLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recyclerView_l"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:overScrollMode="never" />
            </LinearLayout>


        </HorizontalScrollView>

        <LinearLayout
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:background="@mipmap/right_bg_icon"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tvTopRight"
                android:layout_width="60dp"
                android:layout_height="24dp"
                android:background="#E7ECF2"
                android:gravity="center"
                android:text="操作"
                android:textColor="#333333"
                android:textSize="10sp"
                android:textStyle="bold" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recyclerView_r"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </LinearLayout>
    </LinearLayout>

</LinearLayout>

2.适配器加载,两个recycler联动绑定


http://www.kler.cn/news/314638.html

相关文章:

  • 常用的图像增强的算法之间的联系和区别
  • Python3网络爬虫开发实战(17)爬虫的管理和部署(第一版)
  • Samba服务
  • 传统到AI 大数据分析的演变,颠覆智慧水电的未来?
  • 【JavaEE初阶】多线程(4)
  • 2024/9/21黑马头条跟学笔记(十)
  • Ubuntu 安装和使用 Fcitx 中文输入法;截图软件flameshot
  • 从零到一:打造安全高效敦煌测评自养号体系
  • 《C++高效字符串拼接之道:解锁性能与优雅的完美结合》
  • mac系统加密文件
  • Flutter Android Package调用python
  • 基于深度学习的因果推理与决策
  • 【JVM】运行时数据区
  • Ubuntu 20.04 内核升级后网络丢失问题的解决过程
  • 《DevOps实践指南》笔记-Part 3
  • Swift里的数值变量的最大值和最小值
  • 分布式光伏发电站数据采集设备管理硬件解决方案
  • 机器学习——Stacking
  • C++速通LeetCode中等第21题-排序链表(空间O(1))
  • 828华为云征文 | 华为云X实例的镜像管理详解
  • Unexpected end of file from server 错误
  • 系统架构设计师教程 第5章 5.4 软件测试 笔记
  • 论文阅读笔记:Sapiens: Foundation for Human Vision Models
  • MoCo和SimCLR【CV双雄】
  • mxnet算子调用kernel示例(MINIST)
  • Java面试篇-AOP专题(什么是AOP、AOP的几个核心概念、AOP的常用场景、使用AOP记录操作日志、Spring中的事务是如何实现的)
  • SYN Flood攻击原理,SYN Cookie算法
  • 【数据结构C语言】【入门】【首次万字详细解析】入门阶段数据结构可能用到的C语言知识,一章让你看懂数据结构!!!!!!!
  • 我的AI工具箱Tauri版-FasterWhisper音频转文本
  • 什么是 HTTP/3?下一代 Web 协议