-
Notifications
You must be signed in to change notification settings - Fork 699
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's default min width is too wide to align horizontally to right. #4627
Comments
@gaoyulei1983 Can you provide details on what you are trying to achieve. I'm curious if NavigationView is the correct control for this. Would CommandBar serve better for this ? @YuliKl as FYI |
@ranjeshj I use it for the tab header to switch tab page. In WPF, I usually use Tabcontrol. Now in UWP I hope it can be placed to right and top of the page. I also considered to use Pivot, but I was told it will be deprecated in WinUI next version, and CommandBar doesn't support to switch highlight bottom line between its children items naturally, I need to add another control and event to implement so. It is not as good as NavigationView. |
@gaoyulei1983 Thank you for the additional information. As you have noticed, NavigationView was not designed to have its items be right aligned, but you may be able to achieve your scenario by placing your NavigationViewItems into the A word of caution: Based on your row definitions, you may be misunderstanding NavigationView's behavior. As described in the NavigationView design docs, the control is both headers and content. NavigationView will attempt to take up as much available height as possible, so your second row will most likely have a height of 0. For similar reasons, I would not recommend a very narrow NavigationView to avoid showing just a narrow strip as the control's Content. Lastly, regarding this comment:
Icons are not effected by that setting, it only changes the size of text. Please close this issue if FooterMenuItems does what you expect. What you're reporting isn't actually a bug, and FooterMenuItems is the feature we added to support this scenario. |
It looks like you want to use a customised Pivot, but as that control is being deprecated, you may have to wait for progress with this proposal #2310 and then tie that to a frame for navigating pages |
Or just use NavigationView. No need to wait for a new control :) |
Sure if the person is happy to change his layout to match what the NavigationView's layout :) |
I will give you feedback tomorrow. |
You should try populating the <muxc:NavigationView PaneDisplayMode="Top" IsSettingsVisible="False" IsBackButtonVisible="Collapsed">
<muxc:NavigationView.FooterMenuItems>
<muxc:NavigationViewItem IsSelected="True">
<muxc:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem>
<muxc:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
</muxc:NavigationView.FooterMenuItems>
</muxc:NavigationView> |
There is still an bug, although I use FooterMenuItems. I put a button besides the navigationView, and the button can't align to the right besides the two font Icons. The navigationView's default width is still too wide.
|
Chatted with @gaoyulei1983 offline, and NavigationView is not the correct control to use in this scenario. Closing issue. |
@YuliKl you haven't told me what's the correct control I should use. |
Describe the bug
I want to put two font Icons on NavigationView and hide the setting button and align it to the right horizontally. However, it can't be aligned to right because its default min width is 635px. I hope you can reduce its default min width.
Steps to reproduce the bug
I add the code below in my UWP program, and want to show two font Icon button on the NavigationView. I am using PaneDisplayMode="Top" and want to make it align horizontally to right.
However, you can see the screen shot here, its width is too wide, and seems not to be aligned to right.
I also try to set Width="100" for muxc:NavigationView but it can't resolve my problem, because the More button will be shown. I don't want to show More button.
I also try to set Width="145" which is the min width that doesn't show the More button. It is still not aligned to the right.
However, I don't want to set Width for it because the width will change when I change text scale in the windows settings page as below. I also try to set MinWidth = "0" for it, but it doesn't work.
Expected behavior
Hope the two Navigation View font icon align to the right top.
Screenshots
I hope it can show like below that the Navigation View can align to the right when PaneDisplayMode="Top"
The text was updated successfully, but these errors were encountered: