依赖 compile 'com.hjm:BottomTabBar:1.1.1' BottomTabBar bottomTabBar = findViewById(R.id.botab); bottomTabBar.init(getSupportFragmentManager()) .setImgSize(35, 35) .setFontSize(10) .setChangeColor(Color.RED, Color.GRAY) // 参数1:frag0是fragment , 参数2和参数3是 未选中图片和选中图片 .addTabItem("frag0",R.mipmap.ic_launcher,R.mipmap.ic_launcher,fragme.class) .addTabItem("frag1",R.mipmap.ic_launcher,R.mipmap.ic_launcher,fragme1.class) .addTabItem("frag2",R.mipmap.ic_launcher,R.mipmap.ic_launcher,fragme2.class) .addTabItem("frag3",R.mipmap.ic_launcher,R.mipmap.ic_launcher,fragme3.class) .isShowDivider(false); //布局文件<com.hjm.bottomtabbar.BottomTabBar android:layout_width="match_parent" android:layout_height="match_parent " android:id="@+id/botab" />
底部导航栏 BottomTabBar
最新推荐文章于 2024-11-05 13:57:19 发布
本文介绍了如何在Android应用中使用BottomTabBar组件进行底部导航栏的设置,包括依赖引入、初始化方法、自定义样式及添加Fragment等步骤。
598

被折叠的 条评论
为什么被折叠?



