问题描述
我对NavigationView控件和标题栏有疑问.
I have a problem with the NavigationView Control and the titlebar.
我试图将视图扩展到标题栏中,以使用标准NavigationView的丙烯酸效果.但是后来我注意到后退和菜单按钮位于标题栏的下面,因此您无法正确单击它们.
I have tried to extend the view into the titlebar to play with the acrylic effects of the standard NavigationView. But then I´ve noticed that the back and menu buttons are underneath the titlebar, so you´re not able to click them properly.
在所附的图像中,您可以看到红线下方的所有内容都是可单击的,但是当您将其移到上方时,您将以标题栏为目标.
In the attached image, you can see that everything under the red line is clickable but when you go over it, you are targeting the titlebar.
我有什么办法可以解决此问题?
Is there anything I can do to fix this behavior?
推荐答案
我不知道您使用的是哪个版本的OS,在最近的Windows Insider OS中我没有看到此问题.您可以通过设置如下所示的虚拟标题栏来解决不可点击的问题:
I don't know which version OS you are working on, I didn't see this problem in recent Windows insider OS.You may workaround the not clickable problem by set a dummy Titlebar like below:
<Grid>
<Grid x:Name="AppTitleBar" Background="Transparent" />
<NavigationView IsBackEnabled="True" PaneDisplayMode="Top">
<NavigationView.MenuItems>
<NavigationViewItem Icon="Accept" Content="Accept" />
</NavigationView.MenuItems>
</NavigationView>
</Grid>
public MainPage()
{
this.InitializeComponent();
var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;
Window.Current.SetTitleBar(AppTitleBar);
}
这篇关于uwp NavigationView控件标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!