原来不是用这个框架的 是一个不知名的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类里面  没毛病 不会的自行百度

最新文章

  1. centos 6.0用yum安装中文输入法
  2. Linux 内核常见宏定义
  3. [R语言]foreach和doParallel包实现多个数据库同时查询
  4. Python数据类型(3)
  5. 《你不知道的javascript》一、函数作用域和块作用域
  6. 【Android Studio使用教程6】Execution failed for task &#39;:&#215;&#215;&#215;:compileReleaseAidl&#39;
  7. [转] 引用 Java自带的线程池ThreadPoolExecutor详细介绍说明和实例应用
  8. 用CATransform3D实现3D效果和制作简单3D动画
  9. CSS预处理语言——less与sass的使用
  10. iOS-隐藏Navigationbar【导航栏无缝圆滑的隐藏】
  11. 题解 P2763 【试题库问题】
  12. Database Change Notification
  13. Spring 事务 readOnly 到底是怎么回事?
  14. 也谈.Net中间语言——破解Delphi2CS行数和时间限制
  15. USMART 组件移植到STM32
  16. 修改记录-优化后(springboot+shiro+session+redis+ngnix共享)
  17. CentOS 7配置nginx-1.13.10支持http/2和Server Push
  18. RIFF格式简介
  19. JS 读取本地Excel文件
  20. java Apache common-io 讲解

热门文章

  1. Linux命令:grep命令 | egrep命令
  2. 【PAT甲级】1015 Reversible Primes (20 分)
  3. redis 之redis-sentinel主从复制高可用
  4. linux 从一台服务器向另台服务器复制文件
  5. DatePicker和DataPickerDialog以及AutoCompleteTextView的基本使用方法
  6. luogu P3358 最长k可重区间集问题
  7. JDK8中的HashMap源码
  8. C# 篇基础知识4——.NET的基础概念
  9. 1-7SpringBoot之表单验证@Valid
  10. Day 1:思考