Skip to content
Advertisement

Fullscreen DialogFragment overlaps with StatusBar

I created a full screen dialog with the official Guide

The problem is, that my Toolbar overlaps with the status bar and I cannot figure out how to solve this.

DialogFragment

JavaScript

Layout

JavaScript

Toolbar

JavaScript

Activity creating Dialog

JavaScript

Screenshot

EDIT

After removing StatusBarTransparency from v21-styles it looks like this enter image description here

Advertisement

Answer

The problem is in the transaction.add(containerId, fragment) part.

You have it set to: transaction.add(android.R.id.content, fragment), and it is the setting of it to android.R.id.content that is causing the overlap.

Instead, set it to the id of the parent’s content frame in the calling activity.

For example, in my code the main activity parent layout was a DrawerLayout, with id of drawer_layout, so my fix was

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement