现在我正在使用 VS2015、C# 和 XAML 制作 Windows Phone 8.1 应用程序。 并想了解 Commandbar。
我只使用二级命令栏。所以,我想压缩主要的空间,当 Commandbar 弹出时。但我无法解决这个问题。
Ideal Image, commandbar's height short
现在我的代码在这里。
<Page.BottomAppBar>
<CommandBar ClosedDisplayMode="Minimal" Background="Tomato">
<CommandBar.SecondaryCommands>
<AppBarButton x:Name="appBarAboutButton"
Label="about"
Click="appBarAboutButton_Click"/>
</CommandBar.SecondaryCommands >
</CommandBar>
</Page.BottomAppBar>
请告诉我如何解决这个问题。
最佳答案
目前这是命令栏的预期行为,没有解决方法。但是命令栏中有一个名为 Content 的属性。您可以尝试一下,看看它是否符合您的需要。
CommandBar has 3 properties you can use to add content and commands: Content, PrimaryCommands, and SecondaryCommands. You can add any XAML elements to the content area by setting the Content property.
查看此链接了解更多信息 https://msdn.microsoft.com/en-in/library/windows/apps/windows.ui.xaml.controls.commandbar.aspx
关于c# - Windows Phone 8.1 命令栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34785108/