I've added a BottomNavigation with a couple of Buttons to my view. However, when I run my application, only the very top part of the navigation bar shows. When I make my window longer I can see the whole bar. When I set the AppBar visibility to 'false', then the navigation bar shows up nicely. How do I have the BottomNavigation show up properly? Am I adding the BottomNavigation object to the right view?
This is most of my class:
public void initialize() {
primary.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().getDrawer().open()));
appBar.setTitleText("Gluon App");
}
});
primary.setBottom(createBottomNaviagtion());
}
public BottomNavigation createBottomNaviagtion(){
BottomNavigation bottomNavigation = new BottomNavigation();
//.. creating BottomNavigationButtons
bottomNavigation.getActionItems().addAll(/*Buttons here*/);
return bottomNavigation;
}
I realized that the GlassPane contains a AppBar and a View, and like I've been adding the BottomNavigation to the View, I could also add an AppBar to the View. When making the AppBar of the GlassPane invisible, this results in what I wanted: both the AppBar and the BottomNavigation are showing up nicely. I still wonder if this is the correct approach though, any feedback would be appreciated!