bottomnavigationview

How to dynamically hide a menu item in BottomNavigationView?

帅比萌擦擦* 提交于 2019-11-30 17:05:24
I want to hide a menu item of BottomNavigationView dynamically based on some conditions. I tried the following but it is not working. mBottomNavigationView.getMenu() .findItem(R.id.item_name) .setVisible(false); mBottomNavigationView.invalidate(); mBottomNavigationView.getMenu().removeItem(R.id.item_name); removeItem does the trick. Not sure why setVisible method is not working. I tried most of solutions but this worked for me, For hiding an item dynamically : bottomNavigationView.findViewById(R.id.xyz).setVisibility(View.GONE); For making item visible: bottomNavigationView.findViewById(R.id

How to increase Bottom Navigation View height along with its icon and text sizes in android?

倖福魔咒の 提交于 2019-11-30 12:07:49
问题 I am using compile 'com.android.support:design:25.0.0' Android Bottom Navigation View and its height is is fixed and tiny icons with small text are shown. My question is how can i increase their sizes? I've tried to change size in xml file through style... all other properties are working except textsize property. Can i do that pragmatically if so, then please write a code 回答1: I've found a solution to override some dimen values in dimens.xml file it works for the text size but icon still

How to Set selected item in BottomNavigationView

佐手、 提交于 2019-11-30 11:29:16
I am trying to set default item on activity created but it isn't working? This is my code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_userhome); mTextMessage = (TextView) findViewById(R.id.message); profile = (FrameLayout) findViewById(R.id.profile); mall = (FrameLayout) findViewById(R.id.mall); dietplan =(FrameLayout) findViewById(R.id.dietplan); BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation); navigation.setSelectedItemId(R.id.dietplan); navigation

Style BottomNavigationBar in Flutter

为君一笑 提交于 2019-11-30 10:35:07
问题 I am trying out Flutter and I am trying to change the colour of the BottomNavigationBar on the app but all I could achieve was change the colour of the BottomNavigationItem (icon and text). Here is where i declare my BottomNavigationBar : class _BottomNavigationState extends State<BottomNavigationHolder>{ @override Widget build(BuildContext context) { return new Scaffold( appBar: null, body: pages(), bottomNavigationBar:new BottomNavigationBar( items: <BottomNavigationBarItem>[ new

Bottom Navigation Bar: Text size is increasing on pressing?

自闭症网瘾萝莉.ら 提交于 2019-11-30 08:23:44
问题 I am using the Bottom Navigation Bar in Android. By default when I select an item the text size of the label of that item increases. As seen here by the 'tournaments' label. Is there a way to remove this so the word 'tournaments' stays the same size? 回答1: Try to add this code in dimens.xml file <dimen name="design_bottom_navigation_text_size" tools:override="true">10sp</dimen> <dimen name="design_bottom_navigation_active_text_size" tools:override="true">10sp</dimen> 回答2: You can set the

How can I add a menu dynamically to bottom navigation view?

让人想犯罪 __ 提交于 2019-11-30 06:57:25
Android has new ui element - BottomNavigationView I don't want to contain my menus in the xml files. I will receive the information about menu items and order from backend side. I want to create them dynamically and set into the BottomNavigationView in the onCreate() method. Can I do this? By default, BottomNavigationView starts with an empty menu. You can use the getMenu() method to get the Menu instance, then add menu items as in the response above . For example, BottomNavigationView bottomNavigation = findViewById(R.id.bottom_navigation); Menu menu = bottomNavigation.getMenu(); menu.add

Solved: How to add dividers in Bottom Navigation View

China☆狼群 提交于 2019-11-30 04:13:52
I'm trying to add divider in menu items of BottomNavigationView All items are showing horizontally in the bottom but I'm not able to add dividers into it. Bottom Navigation View xml: <android.support.design.widget.BottomNavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:focusable="false" app:itemBackground="@color/colorPrimaryDark" app:itemIconTint="@color/bottom_navigation_selector" app:itemTextColor="@color/bottom_navigation_selector" app:layout_anchor="@id/container" app:layout_anchorGravity="bottom" app:menu="

How to create bottom navigation bar similar to instagram

若如初见. 提交于 2019-11-30 04:08:22
I am an android newbie trying to create a bottom navigation bar for my new android app similar to one there in Instagram. Like this where clicking on the search icon adds a search bar in action bar. I am building an app for reminding the user about his medical appointments which has three navigation tabs at the bottom. I have created till this after this I am stuck. Should I use three activities to display the content of corresponding tabs or fragments and how can I achieve that. I need a recyclerview to display appointments. How can I display the search bar only when the search icon at bottom

How to hide the BottomNavigationView below keyboard with adjustResize set

妖精的绣舞 提交于 2019-11-30 02:54:44
According to the material design spec , when the keyboard appears, the BottomNavigationView should hide underneath it. However, if I set android:windowSoftInputMode="adjustResize" in the Activity's manifest then the BottomNavigationView moves above the keyboard. I need to set adjustResize to enable scrolling to the bottom of the screen while the keyboard is open. However, I do not want the BottomNavigationView to be visible. Can this be done? How it currently looks: The layout XML (in reality there would be a FrameLayout where the EditText is and the EditText would be inside it): <?xml version

Android BottomNavigationView items showing without text also layout does not hiding on scroll [duplicate]

这一生的挚爱 提交于 2019-11-30 01:58:11
问题 This question already has answers here : How to disable BottomNavigationView shift mode? (19 answers) Closed 2 years ago . Hello Guys I have implemented design library BottomNavigationView . Its works perfectly but I don't know why my menu icon are not showing with text also I want it to hide with scroll down such as Floating Action Button . But I didn't find any way to do that. I read Developers Docs but i did not find any solution for my problem. Here is my output - Item Showing only text