Bug 38019 - Can't remove title bar in Material design
Summary: Can't remove title bar in Material design
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-01-26 04:45 UTC by adrianknight89
Modified: 2017-11-02 13:52 UTC (History)
15 users (show)

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


Attachments
Material title bar repro (43.74 KB, application/zip)
2016-01-26 04:45 UTC, adrianknight89
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description adrianknight89 2016-01-26 04:45:00 UTC
Created attachment 14727 [details]
Material title bar repro

Tested on 2.1.0.6503-pre2 with an S6 using API Level 23

Used the following to try to go fullscreen:

In App.cs:

NavigationPage.SetHasNavigationBar(this, false);

In MainActivity.cs:

RequestWindowFeature(WindowFeatures.NoTitle);
Window.AddFlags(WindowManagerFlags.Fullscreen);
global::Xamarin.Forms.Forms.SetTitleBarVisibility(Xamarin.Forms.AndroidTitleBarVisibility.Never);

In style.xml:

<resources>
  <style name="MyTheme" parent="MyTheme.Base">
  </style>
  <style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="windowNoTitle">true</item>
    
    <item name="windowActionBar">false</item>
    <item name="android:windowActionBar">false</item>
    
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
  </style>
</resources>

Title bar doesn't go away. The text on it is successfully hidden, but the frame stays intact.

Please see repro
Comment 1 Jason Smith [MSFT] 2016-01-29 22:40:32 UTC
are you using FormsAppCompatActivity?
Comment 2 adrianknight89 2016-01-30 08:51:39 UTC
Yes. Please see MainActivity.cs
Comment 3 adrianknight89 2016-02-14 04:36:14 UTC
I'm having a related issue. See here https://bugzilla.xamarin.com/show_bug.cgi?id=38227

Seems like there is no way to enter full screen mode at startup at the moment. :|
Comment 4 Werner Schnedl 2016-02-29 11:05:53 UTC
I have this issue too - occurs only if using Master Detail Page on Android. The Code I am using is:

 View decorView = Window.DecorView;
 var uiOptions = (int)decorView.SystemUiVisibility;
 var newUiOptions = (int)uiOptions;

 newUiOptions |= (int)SystemUiFlags.LowProfile;
 newUiOptions |= (int)SystemUiFlags.Fullscreen;
 newUiOptions |= (int)SystemUiFlags.HideNavigation;
 newUiOptions |= (int)SystemUiFlags.Immersive;
 decorView.SystemUiVisibility = (StatusBarVisibility)newUiOptions;

The result is that the status bar is cleared but not hidden and a blue empty bar stays visible.
Comment 5 Werner Schnedl 2016-02-29 13:48:11 UTC
Amendment: The example above worked before I switched to Material Design.
Comment 6 Mark 2016-03-07 23:18:53 UTC
I also have this problem. The title bar occupies space even though it's not supposed to be there when hidden.
Comment 7 adrianknight89 2016-04-29 00:22:00 UTC
Any update on this? I can't update to AppCompat unless this is fixed.
Comment 8 adrianknight89 2016-05-12 23:47:29 UTC
In AppCompat, Forms.SetTitleBarVisibility (AndroidTitleBarVisibility.Never); does not work.
Comment 9 Avidan Chen 2016-09-06 12:42:33 UTC
Please fix it as soon as possible. This issue is preventing us from switching to FormsAppCompatActivity.
Comment 10 adrianknight89 2016-09-13 06:24:52 UTC
Please see: https://github.com/xamarin/Xamarin.Forms/pull/350
Comment 11 Samantha Houts [MSFT] 2016-09-30 23:11:29 UTC
Should be fixed in 2.3.4-pre1. Thank you!
Comment 12 Parmendra Kumar 2016-11-30 16:52:03 UTC
I have checked this issue with Xamarin.Forms 2.3.4-pre1 and this issue has been fixed.


Hence closing this issue.
Comment 13 Selim Maloku 2017-05-31 12:20:50 UTC
I think this bug has returned in Xamarin.Forms 2.3.5.239-pre3, tested on a S4 API 21 and Nexus 5 API 25.

In the same scenario i set the flag :

Window.AddFlags(WindowManagerFlags.Fullscreen);

But the underlay(frame) is still shown, the text is successfully hidden.
Comment 14 adrianknight89 2017-05-31 12:40:03 UTC
The underlay was removed by this PR: https://github.com/xamarin/Xamarin.Forms/pull/892

I'm not sure if it was included in -pre3.
Comment 15 Selim Maloku 2017-05-31 13:52:49 UTC
This fix hasn't been included in any pre/release >= 2.3.5 of Xamarin.Forms...
Comment 16 Blonski 2017-06-01 14:31:50 UTC
not possible to hide statusbar 
via 
  <style name="MainTheme" parent="MainTheme.NoActionBar">
  </style>
  <style name="MainTheme.NoActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
  </style>
or 
// protected override void OnCreate(Bundle bundle)
//{
// base.OnCreate(bundle);
//Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
//Window.DecorView.SystemUiVisibility = StatusBarVisibility.Hidden;

On 
Samsung Google Galaxy Nexus (android 4,3  Api 18)
Xamarin.Forms 2.3.4.247
Comment 17 Blonski 2017-06-01 14:32:09 UTC
not possible to hide statusbar 
via 
  <style name="MainTheme" parent="MainTheme.NoActionBar">
  </style>
  <style name="MainTheme.NoActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
  </style>
or 
// protected override void OnCreate(Bundle bundle)
//{
// base.OnCreate(bundle);
//Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
//Window.DecorView.SystemUiVisibility = StatusBarVisibility.Hidden;

On 
Samsung Google Galaxy Nexus (android 4,3  Api 18)
Xamarin.Forms 2.3.4.247
Comment 18 Songtive Team 2017-11-02 13:52:06 UTC
Any updates on that bug? I experience the same issue - the text from status bar is disappeared but frame is still there:
https://www.dropbox.com/s/nnvnuz9tdrg8yir/2017-11-02_15-43-35.png?dl=0