Provide support to customize the spacing between header items in Tab View#307
Merged
PaulAndersonS merged 2 commits intomainfrom Dec 15, 2025
Merged
Provide support to customize the spacing between header items in Tab View#307PaulAndersonS merged 2 commits intomainfrom
PaulAndersonS merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for customizing the spacing between header items in SfTabView. Previously, this spacing was hardcoded to 36 pixels. The change introduces a new HeaderItemSpacing property that can be configured while maintaining backward compatibility by keeping 36 as the default value.
Key Changes:
- Added
HeaderItemSpacingbindable property toSfTabViewandSfTabBar - Removed hardcoded
_defaultTextPaddingfield and replaced all usages with the new property - Added comprehensive unit tests for the new property
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
maui/src/TabView/Control/SfTabView.cs |
Added public HeaderItemSpacing property with bindable property declaration, property changed handler, and update method |
maui/src/TabView/Control/SfTabBar.cs |
Added internal HeaderItemSpacing property, removed hardcoded field, replaced all usages in width calculation methods |
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfTabViewUnitTests.cs |
Removed obsolete private field tests, added comprehensive tests for HeaderItemSpacing including default value, set/get, and property changed propagation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfTabViewUnitTests.cs
Outdated
Show resolved
Hide resolved
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfTabViewUnitTests.cs
Show resolved
Hide resolved
…ewUnitTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PaulAndersonS
approved these changes
Dec 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause of the Issue
Need to customize the spacing between header items in the TabView. This spacing is currently hardcoded to 36 (see https://github.com/syncfusion/maui-toolkit/blob/main/maui/src/TabView/Control/SfTabBar.cs#L33).
Description of Change
Introduces a new HeaderItemSpacing property on SfTabView, piped down to SfTabBar.
Preserves the current value of 36 as the default.
Screenshots