效果
依赖
compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
OnCreate中初始化
initBottom(); 认选中0 showFragment(0);
然后具体实现
private void showFragment(int position) { FragmentManager supportFragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = supportFragmentManager.beginTransaction(); transaction.replace(R.id.fl_fragment, FragmentFactory.getFragemt(position)).commit(); } private void initBottom() { numberBadgeItem = new BadgeItem() // .setBorderWidth(4) 边框 .setBackgroundColor(Color.RED) .setText("6"); // .setHideOnSelect(autoHide.isChecked()); 点中后干掉 bntBottom .setActiveColor(R.color.maincolor) .addItem(new BottomNavigationItem(R.drawable.conversation_selected_2, "消息").setBadgeItem(numberBadgeItem)) .addItem(new BottomNavigationItem(R.drawable.contact_selected_2, "联系人")) .addItem(new BottomNavigationItem(R.drawable.plugin_selected_2, "动态")) .setFirstSelectedPosition(0) .initialise(); //监听底部导航 bntBottom.setTabSelectedListener(this); } @Override public void onTabSelected(int position) { //当前切换时候调用 showFragment(position); }
以上所述是小编给大家介绍的Android带气泡的第三方Tab选项卡,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对亿速云网站的支持!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。