Toolbar help with alignment

Currently I have the toolbar set as shown in graphic but I’d like to add an icon on the left of the toolbar but as far as I can see there is no way to set it left.

ios has Self.RightNavigationToolbar but not Android

I guess I could add buttons with no text of icon but that can get messy. Any thoughts on how to achieve this would be welcome

image

1 Like

I’m not near a computer to try this, but give this a go.

Toolbar.AddButtonAt(0, New MobileToolbarButton(MobileToolbarButton.Types.Camera))

I hope this helps

Hi Robin

Thanks for the (only) response. I tried as you suggested but still no difference. I’m going to raise a bug as it seems odd behaviour

Thanks Again

1 Like

On Android, toolbar items are aligned to the right.

You can add some space in between buttons like this:

me.Toolbar.AddButton new MobileToolbarButton(MobileToolbarButton.Types.Plain, "Left")

me.Toolbar.AddButton new MobileToolbarButton(MobileToolbarButton.Types.FlexibleSpace)

me.Toolbar.AddButton new MobileToolbarButton(MobileToolbarButton.Types.Plain, "Right")

1 Like

Hi Jeremie

Thanks for the response , I’m still struggling to understand why I’m limited to two or three icons along the bottom when I can easily fit 4 or more depending on screen size of course but on the example you kindly provided there can only be a MAX of three.

I believe that is a limitation of the system.
When using the native toolbar, no more than 3/4 items will be displayed. If there are more items, they will be shown in a popup menu.

Many of the apps I use on my Android Phone offer 5 icons like this:

is this not possible with Xojo Android?

Or it needs to be done outside a Toolbar?

I haven’t used Xojo Android but thinking about it in the future.

Android Nav Bars do it. Up to 5 “buttons”. Have no idea on how to do that in Xojo, but it should to follow the Material3 design.

I haven’t used Android in ages. But that looks like a Tabbed layout, not a single screen with a toolbar.

AFAIK, Xojo doesn’t support Tabbed layouts on Android yet.
You will need to fake it with a container control and some buttons.