Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationView header shows unnecessary indentation #6041

Closed
4 of 22 tasks
HavenDV opened this issue Oct 5, 2021 · 2 comments
Closed
4 of 22 tasks

NavigationView header shows unnecessary indentation #6041

HavenDV opened this issue Oct 5, 2021 · 2 comments
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Milestone

Comments

@HavenDV
Copy link

HavenDV commented Oct 5, 2021

Describe the bug

Current behavior

image
I'm not sure what exactly the problem is. The problem is either indentation or default vertical alignment. This showed up after updating to 3.11.0-dev.242 from about 3.10.0-dev.500

Expected behavior

image

Steps to reproduce the bug

xmlns:muxc="using:Microsoft.UI.Xaml.Controls"

<muxc:NavigationView
  IsSettingsVisible="False"
  AlwaysShowHeader="True"
  IsTabStop="False" 
  IsPaneToggleButtonVisible="True" 
  IsPaneOpen="True" 
  IsPaneVisible="True"
  PaneDisplayMode="LeftCompact"
  >
  <muxc:NavigationView.Header>
    <TextBlock
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Text="Test"
        />
  </muxc:NavigationView.Header>
</muxc:NavigationView>

Expected behavior

No response

Screenshots

No response

NuGet package version

Microsoft.UI.Xaml 2.7.0

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Additional context

Package Version(s):

<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
      <!-- 
			If, in the same solution, you are referencing a project that uses https://github.com/onovotny/MSBuildSdkExtras,
			you need to make sure that the version provided here matches https://github.com/onovotny/MSBuildSdkExtras/blob/master/Source/MSBuild.Sdk.Extras/DefaultItems/ImplicitPackages.targets#L11.
			This is not an issue when libraries are referenced through nuget packages. See https://github.com/nventive/Uno/issues/446 for more details.
			-->
      <Version>6.2.12</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI">
      <Version>7.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Core">
      <Version>7.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.DataGrid">
      <Version>7.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Layout">
      <Version>7.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.UI.Xaml">
      <Version>2.7.0</Version>
    </PackageReference>

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})
  • 19043.985 21H1

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041) Min And Target
  • Insider Build ({build_number})

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.{minor_version})
  • 2022 preview 4.1

Problems appears after upgrade Microsoft.UI.Xaml from 2.6.0-prerelease.210430001 to 2.6.0

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Oct 5, 2021
@StephenLPeters StephenLPeters added area-NavigationView NavView control team-Controls Issue for the Controls team labels Oct 20, 2021
@StephenLPeters StephenLPeters added this to the WinUI 2.8 milestone Oct 20, 2021
@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Oct 20, 2021
@marcelwgn
Copy link
Collaborator

It seems that this padding is intentional, the NavigationViewHeaderMargin resource which defines the margin around the header is set to 56,44,0,0 which would explain the gap at the top. I'm not sure if this is intentional or not but this was introduced with #4779. @karenbtlai maybe you can tell more about this and how to possibly resolve this?

@karkarl
Copy link
Contributor

karkarl commented Nov 18, 2021

Yes, the extra padding is intentional and part of our app design guidance. The reason is because design-wise, we wish for the header to be aligned with the hamburger menu. This is so that NavView components follow a set "grid system", where elements are not all slightly misaligned to some extent.

If you really wish to change the margin, you can override NavigationViewHeaderMargin to revert this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants