Xamarin.Forms
Xamarin.Forms copied to clipboard
[Enhancement] Shell Top Tabs cannot be spaced evenly
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
Reproduction Link
https://github.com/davidortinau/Straxa
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 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?
Hey @PureWeen I agree and this seems a better way to provide them more options to the devs.
So, what about this behavior?
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!