bottomnavigationview

Flutter: Keep BottomNavigationBar When Push to New Screen with Navigator

試著忘記壹切 提交于 2019-12-09 04:21:59
问题 In iOS, we have a UITabBarController which stays permanently at the bottom of the screen when we push to a new ViewController. In Flutter, we have a bottomNavigationBar of a Scaffold. However, unlike iOS, when we Navigator.push to a new screen, this bottomNavigationBar disappears. In my app, I want to fulfil this requirement: Home screen has a bottomNavigationBar with 2 items ( a & b ) presenting screen A & B . By default, screen A is displayed. Inside screen A , there is a button. Tap that

Android BottomNavigationView with custom views as icons [closed]

痞子三分冷 提交于 2019-12-08 15:52:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 months ago . I'm trying out the new BottomNavigationView from the Android Support library. For one of the menu items I would like to have a custom view so that I can add a circular user image programatically as an icon. After using, this does not seem possible with either this support

Traversing from fragment to fragment BottomNavigationView icon highlight

别说谁变了你拦得住时间么 提交于 2019-12-08 11:08:19
问题 i am trying to implement a BottomNavigationView, been successful so far. Currently trying to implement the fragment to fragment movement, which is also successful, but somehow when i move from one fragment[radio] to another[stream] the navigationbar is supposed to highlight the icon[stream] but its not happening is there a way i can set the highlight properties through the fragment itself ? Below is the code and snapshot of my application: MainActivity.java import android.support.annotation

Bottom Navigation View : Change the default highlighted Tab when the app launches

杀马特。学长 韩版系。学妹 提交于 2019-12-08 05:20:37
问题 As shown above, I have this button navigation view, when ever I launch my application, in default my "Catagories" tab gets highlighted, but I want to get my "Home" tab get highlighted when i launch my application, can anyone help me get out of it? 回答1: try this use setSelectedItemId() method of your BottomNavigationView like this BottomNavigationView bottomNavigationView; bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigationView); bottomNavigationView

Bottom Navigation View : Change the default highlighted Tab when the app launches

旧巷老猫 提交于 2019-12-08 02:48:20
As shown above, I have this button navigation view, when ever I launch my application, in default my "Catagories" tab gets highlighted, but I want to get my "Home" tab get highlighted when i launch my application, can anyone help me get out of it? try this use setSelectedItemId() method of your BottomNavigationView like this BottomNavigationView bottomNavigationView; bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigationView); bottomNavigationView.setSelectedItemId(R.id.home_menu); or use viewPager.setCurrentItem(); of your view pager like this viewPager

BottomNavigationView does not hide on scrolling inside fragment, if fragment contains AppBarLayout

隐身守侯 提交于 2019-12-07 14:41:05
问题 I'm having a lot of problems with scrolling and detection of it inside fragments using coordinatorLayout in Android. I have a "MainActivity" that contains 3 fragments. In one of those fragments I have an Appbar that collapses when fragment is scrolled. I've managed to do that, but if I set scrolling behavior to allow that, my bottomNavigationView (which is found in mainactivity.xml) does NOT react to scrolling. Codes go something like this: Fragment1.xml <android.support.design.widget

findViewById(R.id.icon) returns null

有些话、适合烂在心里 提交于 2019-12-06 15:18:43
问题 R.id.icon is already defined in Android API level 1. However, I am getting an NPE in a Android Design Support Library internal code while accessing an imageview inflated using R.id.icon . NOTE: I am not targetting Oreo as my targetSdk is currently 25 . Here is the stacktrace: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.widget.ImageView.getLayoutParams()' on a null object reference at android.support.design.internal

How to create the custom item of Bottomnavigationview Android?

主宰稳场 提交于 2019-12-06 01:46:14
问题 I am using the Bottomnavigationview for tab-bar in my application, for it, i am using the following code.Please check it once. Layout :- <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:itemTextColor="@android:color/black" app:menu="@menu/bottom_navigation_main" /> And I get the following Result from it, please check the image for it. But

Bottom Navigation loading Fragments is SLOW

孤者浪人 提交于 2019-12-05 06:26:27
I'm using a BottomNavigationView in my project and when I press an item and load e.g. My Ticket fragment, which generates a QR-code and takes a while, there is a huge delay until the item is selected. I tried to put an AsyncTask to load all data in onResume() and onActivityCreated() in the Fragment but it didn't work well. How can I use Bottom Navigation View and Fragments smoothly? BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation_view); Menu test = bottomNavigationView.getMenu(); test.add(Menu.NONE, 1, Menu.NONE, "Home").setIcon(R.drawable

How do I add elevation (shadow) to my BottomNavigationView. It doesn't come by default

爷,独闯天下 提交于 2019-12-05 00:38:25
I tried setting elevation from xml and programmatically both. But nothing works. It only works if you set white as android:background in the BottomNavigationView. This is my code and it's working: <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="bottom" android:background="@color/white" app:elevation="8dp" app:itemIconTint="@color/bottom_color_state" app:itemTextColor="@color/bottom_color_state" app:layout_constraintBottom_toBottomOf="parent" app:layout