Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Enhancement] Shell Top Tabs cannot be spaced evenly

Open davidortinau opened this issue 5 years ago • 4 comments

Description

On Android and I think iOS the tabs are smash to one side without the option to space them evenly. This is natively an option in Android and should be available here as well for all platforms.

https://developer.android.com/reference/android/support/design/widget/TabLayout.html#attr_TabLayout_tabGravity

If you push iOS tabs to the top, they are evenly spaced by default (native, not specifically Shell).

Expected Behavior

I can choose the spacing.

Actual Behavior

I have no control unless I write a custom renderer.

Basic Information

  • Version with issue: 4.0-pre9

Screenshots

image

Reproduction Link

https://github.com/davidortinau/Straxa

davidortinau avatar Apr 24 '19 03:04 davidortinau

I was thinking to implement this. Should I just add a bool property (example: SetTabLayoutGravityToFill ) in Shell and ShellApprearance and update native Android TabLayout in ShellTabLayoutAppearanceTracker or should this be a platform-specific functionality?

ravinderjangra avatar Sep 03 '19 13:09 ravinderjangra

@ravinderjangra sorry about getting back to you late on this one.

I wonder for this if we could expose a similar type of Width specification as you do on Grids?

If you want to achieve a set of tabs that are evenly spaced that would be like setting the width on each grid column to "*"

Currently the way the sizing works is "Auto"

This would then allow users to specify a width if they wanted some items to be larger than others. I think just using a bool would be too limiting.

Thoughts?

PureWeen avatar Nov 13 '19 01:11 PureWeen

Hey @PureWeen I agree and this seems a better way to provide them more options to the devs.

ravinderjangra avatar Nov 13 '19 05:11 ravinderjangra

So, what about this behavior?

booooohdan avatar Jan 28 '21 23:01 booooohdan

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

jfversluis avatar Aug 23 '22 11:08 jfversluis