bottomnavigationview

More than 3 items in bottom navigation bar android

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-04 15:23:08
问题 I am new to android and I am trying to make an app with more than 3 elements in the bottom navigation bar. I am able to display them but they are getting clustered at the end and only three are visible properly. Here is my code: <android.support.design.widget.BottomNavigationView android:id="@+id/bottomNavigation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:elevation="15dp" android:layout_gravity="bottom" android:layout_alignParentBottom="true" app:menu="

More than 3 items in bottom navigation bar android

十年热恋 提交于 2021-02-04 15:23:06
问题 I am new to android and I am trying to make an app with more than 3 elements in the bottom navigation bar. I am able to display them but they are getting clustered at the end and only three are visible properly. Here is my code: <android.support.design.widget.BottomNavigationView android:id="@+id/bottomNavigation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:elevation="15dp" android:layout_gravity="bottom" android:layout_alignParentBottom="true" app:menu="

Back button behaviour on activity to fragment in bottom navigation view

浪尽此生 提交于 2021-01-29 11:05:14
问题 I have a bottomnavigationview containing 5 fragments,(Consider A(Home), B, C, D, E) If I go to fragment D and then an Activity (Which is inside fragment D or C or any of 5) and press back button of the device. It is directly going to Home fragment(A), actually, it should go to fragment D or C. I have used botomnavigationview in my previous project but all things were working fine. Happening-- MainActivity+HomeFragment (A)---> Fragment D-->>Activity--->>OnbackPressed--->>HomeFragment Expected-

Clarification: How can I show the BottomNavigationView tab is highlighted if the navigation is done via Menu Item or any other option in android

☆樱花仙子☆ 提交于 2021-01-29 08:11:42
问题 I have a large number of fragments. Here the BottomNavigationView has only four icons for tabs. But each tabs has multiple fragments. For Example: I am in home feed screen defaulty. I have a menu item. Clicks on profile label and moved to profile section. Here it needs to highlight the profile icon. How it can be done without click on the BottomNavigationBar in android. 来源: https://stackoverflow.com/questions/64986344/clarification-how-can-i-show-the-bottomnavigationview-tab-is-highlighted-if

Allow BottomSheet to slide up after threshold is reached on an area outside

谁说我不能喝 提交于 2021-01-29 07:52:10
问题 I am trying to replicate a behavior that the current Google Maps has which allows the bottom sheet to be revealed when sliding up from the bottom bar. Notice in the recording below that I first tap on one of the buttons at the bottom bar and then slide up, which in turn reveals the sheet behind it. I cannot find anywhere explained how something like this can be achieved. I tried exploring the BottomSheetBehavior and customizing it, but nowhere I can find a way to track the initial tap and

Android BottomNavigationView leave blank space after being removed/hidden

你离开我真会死。 提交于 2021-01-29 07:42:56
问题 When user in not authenticate, it goes to Login fragment, if he's authenticate it goes to home fragment. When unauthenticated user open the app, the bottomNavView should be hidden, it is but it leaves a blank space. class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val navigationController = findNavController(R.id.nav_host_fragment) val bottomNavigationView = findViewById

using different Background Color of Bottom NavigationBar Tab

那年仲夏 提交于 2021-01-29 07:20:27
问题 I'm adding a BottomNavigationView to a project, and I would like to have a different background color for each bottom tab.Using a different color with android:state_selected="true" in a color selector resource file doesn't seem to work.I also tried to entered more things like android:state_focused="true" or android:state_enabled="true", no effect unfortunately. (BottomnavigationView) <android.support.design.widget.BottomNavigationView android:id="@+id/bottomNavigationView" android:layout

How can I have the BottomNavigationBar respond to navigation to a new page via AlertDialog?

独自空忆成欢 提交于 2021-01-28 08:08:44
问题 I have a navigation_bar.dart file that handles changing to new pages within my app. Within it, I am using the bottomNavigationBar to build out four different pages based on what tab is currently selected like so: class NavigationBar extends StatefulWidget { @override _NavigationBarState createState() => _NavigationBarState(); } class _NavigationBarState extends State<NavigationBar> { int _selectedIndex = 0; final List<Widget> _pageOptions = <Widget>[ Page1(), Page2(), Page3(), Page4(), ];

How to use Dynamic Feature module with BottomNavigationView?

寵の児 提交于 2020-12-26 08:33:24
问题 Adding dynamic feature using a navigation graph like the one below and works fine with viewPager2, or another fragment, but not with a BottomNavigationView . Layout <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/nav_host_container

How to use Dynamic Feature module with BottomNavigationView?

左心房为你撑大大i 提交于 2020-12-26 08:31:38
问题 Adding dynamic feature using a navigation graph like the one below and works fine with viewPager2, or another fragment, but not with a BottomNavigationView . Layout <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/nav_host_container