BottomTabBar 套用 recycleview出错问题
2024-10-08 17:21:07
原来不是用这个框架的 是一个不知名的github开源类 开始感觉很不错 后来套用recycleview就出错应该是碎片关系没处理好 ,后来用bottomtabbar 他的傻逼思想深深撼动了我,因此bottombar也出错 导致我写这篇文章(本人小白尽全力描述遇到的问题)
BottomTabBar 封装的相当不错了,个人感觉 关于fragment 他封装很好懒人加载 点哪一行才会请求网络而且只请求一次
说布局
activity_main.xml 这里不需要写什么固定的 你只要把 BottomTabBar 标签加进去 其他的布局写的你fragment里面
<?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"> <com.hjm.bottomtabbar.BottomTabBar
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/bottom_bar">
</com.hjm.bottomtabbar.BottomTabBar> <!--<com.stdu.x5.utils.BottomBar-->
<!--android:background="#CD2990"-->
<!--android:id="@+id/bottom_bar"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="48dp"-->
<!--android:layout_gravity="bottom" />--> </LinearLayout>
fragment 里面的layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/firstpagerecycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</androidx.recyclerview.widget.RecyclerView> </FrameLayout>
关于mainactivity类里面 没毛病 不会的自行百度
最新文章
- centos 6.0用yum安装中文输入法
- Linux 内核常见宏定义
- [R语言]foreach和doParallel包实现多个数据库同时查询
- Python数据类型(3)
- 《你不知道的javascript》一、函数作用域和块作用域
- 【Android Studio使用教程6】Execution failed for task &#39;:&#215;&#215;&#215;:compileReleaseAidl&#39;
- [转] 引用 Java自带的线程池ThreadPoolExecutor详细介绍说明和实例应用
- 用CATransform3D实现3D效果和制作简单3D动画
- CSS预处理语言——less与sass的使用
- iOS-隐藏Navigationbar【导航栏无缝圆滑的隐藏】
- 题解 P2763 【试题库问题】
- Database Change Notification
- Spring 事务 readOnly 到底是怎么回事?
- 也谈.Net中间语言——破解Delphi2CS行数和时间限制
- USMART 组件移植到STM32
- 修改记录-优化后(springboot+shiro+session+redis+ngnix共享)
- CentOS 7配置nginx-1.13.10支持http/2和Server Push
- RIFF格式简介
- JS 读取本地Excel文件
- java Apache common-io 讲解