bottomnavigationview

How to set inactive tab colour for BottomBar

孤街浪徒 提交于 2019-12-12 03:48:42
问题 I am trying to set the colour for the inactive tabs on BottomBar but can't find any method for doing so. I have set the background colour for the bar using this: mBottomBar.getBar().setBackgroundColor(getResources().getColor(R.color.colorPrimary)); and would like to set the tabs to appear as white even when not in use, however don't seem to be able to do it: I am trying this method, but it doesn't work: mBottomBar.mapColorForTab(0, "#ffffff"); on all the four tabs e.g. .mapColorForTab(1, "

cant use NavigationView and BottomNavigationView at the same activity

强颜欢笑 提交于 2019-12-11 17:21:31
问题 I can't use BottomNavigationView and NavigationView at the same activity. NavigationView click listener doesn't work when I use BottomNavigationView but BottomNavigationView click listener works. BottomNavigationView is blocking NavigationView 's click listener somehow. ty for help bottomnavid.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { if(menuItem.getItemId()=

How to implement RecyclerView on a FrameLayout?

帅比萌擦擦* 提交于 2019-12-11 16:27:16
问题 I am learning RecyclerView and stuck in activity. I have a bottomNavigationView and a frame layout above the bottomNavigationView I want to show a RecyclerView on that FrameLayout. How can I do that? There is no error in my program and i don't know why its not showing the RecyclerView. This is the xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width

Unable to set color/background selection for Selected Item in Navigation Drawer + BottomAppBar

China☆狼群 提交于 2019-12-11 10:13:02
问题 I am using a BottomNavigationDrawer/BottomSheetDialog from the following example, but I am unable to set the text and background color for the selected item in my bottom navigation menu. I have tried the following SO questions' solutions but there seems to be no effect at all, and my menus all show up in colorPrimary (black) on a menu background color (white), with no separator or indicator that an item has been selected. I have tried this question, this one, this one, this one and this one,

Custom item in the BottomNavigationView

自古美人都是妖i 提交于 2019-12-11 09:05:26
问题 I would like to create a BottomNavigationView with menu with one custom layout item, but this custom layout is not visible in application. This is the menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_shopping" android:icon="@drawable/ic_tab_list" android:title="@string/shopping" /> <item android:id="@+id/menu_measurement" android:icon="@drawable/ic_tab_measure" android:title="@string

How to programmatically change Bottom Navigation View's Icons?

冷暖自知 提交于 2019-12-11 07:36:34
问题 I want know how can I change Bottom Navigation View's Icons when user basically selects it and then again replace it with previous icon if user selects different option. Below is my switch case snippet. switch (menuItem.getItemId()) { case R.id.ic_home: selectedFragment = new HomeFragment(); //menuItem.setIcon(R.drawable.like_colored); break; case R.id.ic_connect: selectedFragment = new ConnectionFragment(); break; case R.id.ic_add: selectedFragment = new AddPostFragment(); break; case R.id

Bottom Navigation View gets Shrink Down

孤街醉人 提交于 2019-12-11 04:18:41
问题 I have made an app with bottom navigation view with Promo, Store, Reward, Coupon and Account tabs when I am changing from Coupon fragment to any other fragment, the bottom navigation view gets shrunk down as shown in the image, I tried changing layout width, height and converting coordinator layout to linear layout but it didn't help. The problem is occurring when I'm switching from home to any other tab only. Layout File activity_main.xml <android.support.constraint.ConstraintLayout xmlns

Animation issues when using BottomNavigationView with NavController and each Fragment has its own Toolbar

本秂侑毒 提交于 2019-12-10 18:28:41
问题 The bounty expires in 12 hours . Answers to this question are eligible for a +100 reputation bounty. Josh Hardman wants to draw more attention to this question. I'm developing an app in Kotlin using some of the latest Android Jetepack components. I've recently had a bit of a hitch with the following case: This issue seems to occur when using BottomNavigationView with NavController , and when each Fragment has its own Toolbar . The problem is that when transitioning from Fragment A to Fragment

How to use tablayout with bottom navigation and viewpager?

给你一囗甜甜゛ 提交于 2019-12-10 17:19:22
问题 I created an activity with a bottom navigation bar . I want tablayout when I want to switch to another fragment. And tablayout can control viewpager . Can I put viewpager to the specified fragment? I wanna like this: This is the current result. I want to put viewpager in the red box. 回答1: Try this to sync your BottomNavigationView and TabLayout with ViewPager myBottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override

Flutter update BottomNavigationBar

倾然丶 夕夏残阳落幕 提交于 2019-12-09 07:55:34
问题 I am using a BottomNavigationBar together with a TabController. By clicking on the different Tabs of the BottomNavigationBar the TabView is changing the content. However if I swipe on the TabView to switch to another view/tab the BottomNavigationBar is not updating to the tab I swiped to. I already have added a listener to the TabController to detect changes. But how can I update BottomNavigationBar programmatically to reflect the change? 回答1: I think it is way more elegant to use PageView