Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Google Pixel - Immersive Sticky Mode can't get rid of black bars

$
0
0

@bedroomlab wrote:

I have a game which runs full screen fine on various Android devices but on Google Pixel 2XL I can't seem to get rid of the action bar or title bar properly. The icons and buttons tween off but the black background remains.

I think the code is all correct:
styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Splash" parent="android:Theme.Holo.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>

In MainActivity.cs I have this function which is called in OnCreate, OnResum, OnWindowFocusChanged
private void SetImmersive() {
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat) {
Window.DecorView.SystemUiVisibility = (StatusBarVisibility)(SystemUiFlags.LayoutStable | SystemUiFlags.LayoutHideNavigation | SystemUiFlags.LayoutFullscreen | SystemUiFlags.HideNavigation | SystemUiFlags.Fullscreen | SystemUiFlags.ImmersiveSticky);
}
}

OnCreate has this
RequestWindowFeature(WindowFeatures.NoTitle);
Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

GraphicsDeviceManger.ResetClientBounds tells me the bounds contain the bars still. If I hack the dimensions here I can get rid of the title bar black area but the action bar remains.

I did some Googling and it sounds like this is expected behaviour on the Pixel, but then some apps dont have this problem implying there must be a way around it.

Any ideas what to do?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles