zoukankan      html  css  js  c++  java
  • BottomTabBar 套用 recycleview出错问题

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

  • 相关阅读:
    集合介绍,创建,添加,删除。
    字典简介、操作、内置函数、练习题
    git教程——简单总结
    前端性能优化总结
    小米2018春招实习笔试题总结
    浏览器缓存控制 以及 在url框中回车、F5 和 Ctrl + F5的区别
    携程2018春招实习前端开发笔试题分享
    不同方式实现两列布局
    移动端开发-viewport与媒体查询
    华为2018春招前端开发实习生笔试题分享
  • 原文地址:https://www.cnblogs.com/xuexidememeda/p/10353829.html
Copyright © 2011-2022 走看看