My MainView
extends
of an AppLayout
.
I want to fill the Navbar with a logo on the left side of it and the user id on the right side of the Navbar.
Unfortunately everything I tried ends with both Components bound to the left side.
Navbar goal:
| Image -------------------------------------------------------------------------------------------------------- UserID |
Example code (same outcome with Vaadin 14 Image and a String):
public class MainView extends AppLayout
...
private void setupNavigationBar() {
Div a = new Div();
a.setText("Foo");
a.getStyle().set("flex-flow", "flex-start");
Div b = new Div();
b.setText("Bar");
b.getStyle().set("flex-flow", "flex-end");
addToNavbar(a, b);
}
Navbar outcome:
| FooBar ------------------------------------------------------------------------------------------------------------------ |
What is the issue here? Why does the flex-flow
not work? I already tried to wrap it in a HorizontalLayout
which also does not work.