maui icon indicating copy to clipboard operation
maui copied to clipboard

Not able to equally space menu items of BottomNavigationView using Shell in Android Tablets

Open MohdIB opened this issue 1 year ago • 8 comments

Description

I've set up this MAUI Shell project and removed one item from the BottomNavigationView. Once removed the remaing three items are concentrated in the center. This issue is easily noticeable in tabs of large display size.

Having four items makes it seem to be equally spaced in potrait mode but technically not as in Landscape mode, the menu items are centered even for four items. Tried implementing a CustomShellRenderer for android but no expected output.

This issue is observed only in android devices and not not in iOS (The items are equally spaced by default)

Screenshot 2024-07-11 at 5 25 28 PM

Steps to Reproduce

  1. Clone the attached .NET Shell project
  2. Remove one ShellContent item from AppShell.xaml
  3. Build the application in an android tablet of size greater or equal to 10 inches.
  4. Observe the Bottom Navigation Menu Items.

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/8.0/Fundamentals/Shell

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 9 and up

Did you find any workaround?

No.

Relevant log output

No response

MohdIB avatar Jul 15 '24 06:07 MohdIB

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jul 15 '24 06:07 github-actions[bot]

This problem cannot be reproduced at Android platform on the latest 17.11.0 Preview 3.0(8.0.40 & 8.0.60). image (4)

RoiChen001 avatar Jul 15 '24 07:07 RoiChen001

Remove one menu item (e.g. bears) and see that the items are not equally spaced. The three items will be centered.

Having four items makes it seem to be equally spaced visually. In landscape mode, having four items too makes them positioned centered. Xaminals Four Items Centered

MohdIB avatar Jul 15 '24 07:07 MohdIB

Can repro this issue at Android platform on the latest 17.11.0 Preview 3.0(8.0.40 & 8.0.60).

RoiChen001 avatar Jul 15 '24 08:07 RoiChen001

Interesting, we set the visibility mode to LabelVisibilityLabeled which I was thinking would equally space everything

PureWeen avatar Jul 15 '24 14:07 PureWeen

I tried to set the visibility mode to LabelVisibilityLabeled in the shell custom render, this issue still existed.

MohdIB avatar Jul 16 '24 07:07 MohdIB

Not able to equally space menu items of BottomNavigationView using Shell in Android Tablets even after using many ways in Shell Custom Renderer for Android.

Commenting to highlight the urgency of this issue.

MohdIB avatar Jul 18 '24 10:07 MohdIB

@PureWeen, Any update or help on this open issue as i am unable to get a work around to equally space menu items of BottomNavigationView using shell in Android Tablets.

MohdIB avatar Jul 23 '24 11:07 MohdIB

Hi, @MohdIB, I'm not sure it is possible with the BottomNavigationView. Currently, the BottomNavigationView in the MAUI app behaves like the native Android one generated by Android Studio, and Android doesn't seem to provide a property that would let developers to evenly distribute icons across the full width of the view

Image

kubaflo avatar Dec 16 '24 00:12 kubaflo