Skip to content

PivotPanel in Pivot only shows one header #3596

Closed

Description

@davidjohnoliver

How to reproduce it (as minimally and precisely as possible)

  1. In Uno's default Pivot style, replace <Grid x:Name="Panel" with <PivotPanel x:Name="Panel" (matching Windows).

  2. Run either of the pivot samples.

Current behavior

The first tab header stretches the entire width, no others are visible.

Expected behavior

Headers don't stretch, all headers are visible.

Environment

Nuget Package:

Package Version(s):

Affected platform(s): Tested on iOS, probably affects others

  • iOS
  • [?] Android
  • [?] WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    on Jul 22, 2020
  2. self-assigned this
    on Aug 17, 2020
  3. removed
    triage/untriaged
    on Aug 28, 2020
  4. modified the milestone: 3.1 on Aug 28, 2020
  5. added
    project/navigation-lifecycle 🧬
    on Sep 21, 2020
  6. added
    difficulty/tbd
    on Feb 15, 2021
  7. added
    difficulty/medium 🤔
    and removed
    difficulty/tbd
    on Jun 1, 2021
  8. MartinZikmund commented on Jun 1, 2021

    @MartinZikmund
    Member

    @ajpinedam can I unassign you for now, or are you planning to look into pivot next?

  9. added
    area/pivot
    on Jun 4, 2021
  10. changed the title [-]PivotPanel in Pivot only shows one header[/-] [+]`PivotPanel` in `Pivot` only shows one header[/+] on Jun 14, 2023
  11. added
    project/layout 🧱
    project/items 🧾
    and removed
    project/navigation-lifecycle 🧬
    on Jun 14, 2023
  12. github-actions commented on Jul 26, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  13. added
    stale
    on Jul 26, 2025
  14. removed
    stale
    on Jul 27, 2025
  15. MartinZikmund commented on Jul 27, 2025

    @MartinZikmund
    Member

    Still relevant

  16. MartinZikmund commented on Apr 7, 2026

    @MartinZikmund
    Member

    Repro generator

    Runtime test(s) added in branch dev/mazi/repro/3596:

    • src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_Pivot.cs → When_PivotPanel_Used_Multiple_Headers_Are_Visible

    ⚠️ The test(s) pass on current master (Skia Desktop) — all 3 PivotHeaderItem elements have ActualWidth > 0 and none stretch to the full pivot width. The original bug was reported on iOS where native layout + PivotPanel replacement caused only the first header to be visible. The branch serves as a regression guard for the managed path.

  17. added
    area/porting 🖨️
    on Jun 4, 2026
  18. added
    native-only
    on Oct 14, 2026
  19. MartinZikmund commented on Nov 7, 2026

    @MartinZikmund
    Member

    The default Pivot templates now use PivotPanel as the "Panel" part, matching WinUI, after the panel was ported in #25143, and headers are laid out side by side at their natural width. There is also a regression test for this case:

    [TestMethod]
    [RunsOnUIThread]
    [GitHubWorkItem("https://github.com/unoplatform/uno/issues/3596")]
    public async Task When_Multiple_Items_Then_Headers_Not_Stretched()
    {
    const double PivotWidth = 400;
    var pivot = new Pivot
    {
    Width = PivotWidth,
    Height = 200,
    Items =
    {
    new PivotItem { Header = "One", Content = new TextBlock { Text = "Content 1" } },
    new PivotItem { Header = "Two", Content = new TextBlock { Text = "Content 2" } },
    new PivotItem { Header = "Three", Content = new TextBlock { Text = "Content 3" } },
    },
    };
    await UITestHelper.Load(pivot);
    var headers = pivot.GetAllChildren(null, false)
    .OfType<PivotHeaderItem>()
    .Where(h => h.ActualWidth > 0)
    .ToArray();
    Assert.IsGreaterThanOrEqualTo(3, headers.Length, "All headers should be laid out");
    foreach (var header in headers)
    {
    Assert.IsLessThan(PivotWidth / 2, header.ActualWidth, $"Header '{header.Content}' should not stretch across the Pivot");
    }
    }
    . This is on master and ships in 7.0, so please open a new report if you still see it after that.

    This was checked as part of an AI-assisted backlog review by reading the code, not by running it. If it looks wrong, please reply and we will take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pivotarea/porting 🖨️difficulty/medium 🤔has-repro-branchkind/bugnative-onlyproject/items 🧾project/layout 🧱

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions