This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 45835 - There is a blank space on the screen top on UWP 14393(Windows 10 1607 Mobile)
Summary: There is a blank space on the screen top on UWP 14393(Windows 10 1607 Mobile)
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows (show other bugs)
Version: 2.3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-24 14:28 UTC by Mike
Modified: 2017-04-05 08:04 UTC (History)
5 users (show)

See Also:
Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot (37.56 KB, image/png)
2016-10-24 17:25 UTC, Mike
Details
Another app showing the same problem (116.22 KB, image/png)
2016-10-24 17:43 UTC, John Hardman
Details
statusbar (10.68 KB, image/png)
2016-10-24 18:03 UTC, Samantha Houts
Details
I think maybe on the mobile mode, it tought it's on the desktop mode and leave some space for UWP desktop title bar. Like this picture (7.47 KB, image/png)
2016-10-24 21:51 UTC, Mike
Details

Description Mike 2016-10-24 14:28:45 UTC
I was using 10586 before, All normal. But after I update to 14393, The top has a blank space on the mobile version. too ugly, because that is display over the Navigator(which display the App name). Is that a BUG or design??   Desktop UWP all normal, but the mobile or the mobile emulator you could see it over the navigator.(In the normal case there are nothing over the Navigator, It's look like Navigator has set Margin.Top = 20)
Comment 1 Samantha Houts 2016-10-24 17:19:12 UTC
@Mike:

Do you have a small reproduction project and/or screenshots you can provide to show this issue?

Warm regards,
Xamarin Forms Team
Comment 2 Mike 2016-10-24 17:25:17 UTC
Created attachment 18197 [details]
Screenshot
Comment 3 Mike 2016-10-24 17:25:55 UTC
@Samantha Houts, I uploaded it.
Comment 4 Samantha Houts 2016-10-24 17:36:04 UTC
Thank you! To be sure I'm looking at the same issue, would you mind providing the XAML that you're using for that page?
Comment 5 John Hardman 2016-10-24 17:43:24 UTC
Created attachment 18198 [details]
Another app showing the same problem
Comment 6 Samantha Houts 2016-10-24 18:03:26 UTC
Created attachment 18202 [details]
statusbar

The space that is indicated in both screenshots is where the status bar typically is (see my attachment). Does this mean that you are hiding the status bar in your applications? If so, what code are you using to do this?
Comment 7 Samantha Houts 2016-10-24 19:04:03 UTC
I am able to reproduce this behavior in my sample app. There is a black space where the status bar information should be in a new app. The status bar information should appear in that space, but it may not if you do not reference Windows Mobile Extensions for the UWP in the UWP project. I see this phenomenon in both 10586 and 14393, but it is more apparent in 14393 because the space is white instead of black. 

After further investigation, there appears to be a change in 14393 that makes the status bar default to white instead of black. 

We will look into applying the Navigation BarBackgroundColor and BarTextColor to the StatusBar automatically. As an immediate workaround, you may add the following code to your UWP App.xaml.cs in OnLaunched:

			if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
			{

				var statusBar = StatusBar.GetForCurrentView();
				if (statusBar != null)
				{
					statusBar.BackgroundOpacity = 1;
					statusBar.BackgroundColor = Colors.Black;
					statusBar.ForegroundColor = Colors.White;
				}
			}

You may set the colors there to whatever you need. Or, if you prefer, you can simply hide the status bar altogether:

                                 await statusBar?.HideAsync();

Please note that you will need to add the reference Windows Mobile Extensions for the UWP for the above code to work.
Comment 8 Mike 2016-10-24 19:04:38 UTC
@Smantha Houts, Actually you could create Blank app(Xamarin.Forms shared) in visual studio 2015 you could see that all on the win 10 1607 version of mobile or emulator. The page must be the NavigationPage which content page has title.

Do you mean that's a new feature? that we need to set the top margin in every page in new windows 10?  Like iPhone??
Comment 9 Mike 2016-10-24 19:10:15 UTC
@Samantha Houts, No I insist in 10586 no this kind of space.  The Navigation are just behind the screen, There are no anything between Navigation title and top of screen.
Comment 10 Mike 2016-10-24 21:51:38 UTC
Created attachment 18206 [details]
I think maybe on the mobile mode, it tought it's on the desktop mode and leave some space for UWP desktop title bar.  Like this picture

I think maybe on the mobile mode, it tought it's on the desktop mode and leave some space for UWP desktop title bar.  Like this picture
Comment 11 John Hardman 2016-10-24 22:04:03 UTC
@Samantha Houts - Many thanks for such a speedy response. The code above seems to resolve the problem for me.
Comment 12 Mike 2016-10-25 13:05:02 UTC
Fixed mine too. Thank you @Samantha Houts. :-)
Comment 13 Jason Smith 2016-11-15 19:46:47 UTC
Should be fixed in 2.3.4-pre1
Comment 14 dpedrinha 2017-04-05 01:17:21 UTC
StatusBar doesn't exist in 2.3.3. I can't import it.
Comment 15 dpedrinha 2017-04-05 08:04:25 UTC
OK, this article has the fix for my problem:
http://www.puresourcecode.com/dotnet/post/Xamarin-forms-UWP-Windows-10-App-TitleBar-and-Status-bar-customization

Note You need to log in before you can comment on or make changes to this bug.