[UWP] [XAML C#]如何使StatusBar覆盖应用程序 [英] [UWP][XAML C#]How To Make StatusBar Overlay The App

查看:76
本文介绍了[UWP] [XAML C#]如何使StatusBar覆盖应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于
显示StatusBar


我想开始一个新线程作为原始线程,技术上回答。

This is a branch off another thread about Showing StatusBar.
I wanted to start a new thread as the original one, technically, was answered.

我遇到的问题是我的内容垂直位于StatusBar下面。

我希望StatusBar覆盖我的顶部内容(显然,我需要调整边距和填充,以便图标不会覆盖内容)。

在Windows Phone 8.x中,我可以将SystemTray的不透明度设置为0 。$
在UWP中,如果显示StatusBar,内容会被推下。

.HideAsync()用内容填充屏幕,而.ShowAsync()不会。$
BackgroundOpacity和BackgroundColor的任何组合似乎都没有解决问题。

我玩Margin,但它似乎是一个非常繁琐的wa处理问题。

The problem, that I'm having, is that my content is vertically below StatusBar.
I want StatusBar to overlay the top of my content (obviously, I'll need to adjust margins and paddings so that the icons won't be covering the content).
In Windows Phone 8.x, I could just set Opacity of SystemTray to 0.
In UWP, it seems, the content is pushed down if StatusBar is shown.
.HideAsync() fills the screen with content while .ShowAsync() doesn't.
Any combination of BackgroundOpacity and BackgroundColor doesn't seem to fix the issue.
I played with Margin, but it seems like a very cumbersome way of handling the issue.

当然,有一种更简化的方法让StatusBar覆盖内容。

为了进一步澄清,我正在使用Hub使用UniformFill背景图像进行控制。

Certainly, there is a more streamlined means of having StatusBar overlay the content.
For further clarification, I'm using the Hub control with a UniformFill background image.

看起来StatusBar正在强制实施应用程序范围的保证金。

JJ

It seems like StatusBar is enforcing an app-wide Margin.
JJ

推荐答案

我遇到同样的问题...

I'm with the same problem...

我发现你可以让你的应用覆盖状态栏通过调用此方法

I've found out that you can get your app to overlay the status bar by calling this method

ApplicationView .GetForCurrentView()。SetDesiredBoundsMode( ApplicationViewBoundsMode .UseCoreWindow)

ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow)

在模拟器上,一切都按预期工作,状态栏覆盖应用程序,我只需要担心在屏幕顶部设置填充。

On the emulator, everything works just as expected, the status bar overlays the app and I just need to worry about setting paddings on the top of the screen.

在设备上,虽然,这种方法似乎有另一种副作用。底部导航栏,带有后退,窗口和搜索按钮的导航栏也覆盖了应用程序。因此,当部署到设备时,我将不得不担心底部填充。

On the device, although, this method seems to have another side effect. The bottom navigation bar, the one with back, windows and search buttons, overlays the app as well. So, when deploying to the device I'll have to worry about bottom paddings.

我找不到任何关于此的文档,我不知道哪种行为是正确的。它是设备还是模拟器?

I couldn't find any documentation about this and I don't know which behaviour is the right one. Is it the device or the emulator?

仿真器运行10.0.10240.0,设备运行在10.0.10512.1000。是否有新版本的模拟器?

Emulators are running 10.0.10240.0 and the device is on 10.0.10512.1000. Is there any new version of emulators available?

Thiago


这篇关于[UWP] [XAML C#]如何使StatusBar覆盖应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆