简体   繁体   English

WP8.1不透明隐藏的AppBar / CommandBar

[英]WP8.1 Opaque hidden AppBar/CommandBar

How do I achieve opaque CommandBar/AppBar while it's hidden in WP8.1? 隐藏在WP8.1中的不透明CommandBar / AppBar如何实现? CommandBar's property Opacity works just fine, but only when AppBar is opened. CommandBar的属性Opacity可以正常工作,但仅在打开AppBar时有效。 Though even then you can see non-opaque rectangle at the bottom. 即使这样,您仍然可以在底部看到不透明的矩形。 I want my AppBar to be opaque at all times, even when ClosedDisplayMode is set to Minimal. 我希望我的AppBar始终都是不透明的,即使ClosedDisplayMode设置为Minimal。

[UPDATED] "This happens because when you create a CommandBar an automatic margin is created for the ContentGrid to free a space below it for the app bar. Give the Main Grid a bottom margin by -24 and your content will show behind the command bar Like this: Margin="0,0,0,-24" [更新]“发生这种情况是因为当您创建CommandBar时,会为ContentGrid创建一个自动边距,以在其下方为应用程序栏释放一个空间。将Main Grid的底部边距设置为-24,并且您的内容将显示在命令栏的后面像这样:Margin =“ 0,0,0,-24”

[ORIGINAL COMMENT] I guess it is not applicable to do it with the control itself. [原始评论]我猜想它不适用于控件本身。 But the workaround is to give it an opaque color. 但是解决方法是为它提供不透明的颜色。 You can give the command bar a color but reduce its alpha value that controls the color's transparency. 您可以为命令栏设置颜色,但减小其Alpha值来控制颜色的透明度。

Example: that's the Color code of the "Red" color with 80% transparency: #CCFF0000 示例:这是透明度为80%的“红色”颜色的颜色代码:#CCFF0000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM