• 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类里面  没毛病 不会的自行百度

  • 相关阅读:
    python中if __name__ == '__main__': 的解析
    CPPUTest 单元测试框架(针对 C 单元测试的使用说明)
    哈希表详解
    使用RSS提升DPDK应用的性能(转)
    DPDK内存管理-----rte_mbuf(转)
    DPDK内存管理-----(二)rte_mempool内存管理
    DPDK内存管理(1)(转)
    Scala + IntelliJ IDEA
    什么是消息队列中间件
    微信小程序直播
  • 原文地址:https://www.cnblogs.com/xuexidememeda/p/10353829.html
Copyright © 2020-2023  润新知