I am currently making a for windows phone, in the app I am trying to hide the status bar, it works fine, as it should on windows phone 8.1 but on windows phone 10 i get some weird results.
here is the XAML im using
<Canvas x:Name="canvas"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Background="Black"
Height="Auto">
like i said it works in every emulator/actual devices 8.1 and not on any windows 10 phones
as shown in the image below here is what i have tried
- if i don't hide the status bar it loads fine
- if i do hide the status bar the whole page shifts up and leaves a gap
if i set the canvas height by code to
canvas.height = window.current.bounds.height
the whole app falls behind the commandbar.
if i set the canvas height by code to
canvas.height = (window.current.bounds.height - CBar.height)
i get the same as the first issue
both times the gap has appeared it is the same height as the commandbar when it is expanded (tapped on)
so is this a
- command bar issue where the canvas is detecting the commandbar but at its expanded height
- the canvas thinks the status bar is still there so doesnt expand but is automatically moved up
- the canvas just isnt set correctly
its been driving me crazy can someone please help thanks
Update
canvas.height = double.NaN
Does Nothing
var statusBar = StatusBar.GetForCurrentView();
canvas.height = (cavas.height + statusBar.OccludedRect.Height);
await statusBar.HideAsync();
Does Nothing