question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BottomSheet appears to go behind the statusBar

See original GitHub issue

Hello

I have the following code that I inflate for my bottom sheet:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white">

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Upload a picture"
    android:layout_margin="16dp"
    />
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Option 1"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="16dp"
    />
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Option 2"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="16dp"
    />
</LinearLayout>

It inflates fine - but the problem is that if you drag the bottomsheet to the top of the screen, some of it hides behind the statusBar.

Before I drag it to the top (peekSheet):

borttomsheet

After dragging it to the top - you can see that the “Upload a picture” text is hidden somewhat :

bottomsheetexpanded

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Winghin2517commented, Oct 20, 2015

Sorry - I figured it out guys.

I had the following code in my layout file:

<com.flipboard.bottomsheet.BottomSheetLayout android:id=“@+id/bottomsheet” android:layout_width=“match_parent” android:layout_height=“match_parent” xmlns:android=“http://schemas.android.com/apk/res/android” xmlns:tools=“http://schemas.android.com/tools” xmlns:app=“http://schemas.android.com/apk/res-auto”>

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    >

Because I have said android:fitsSystemWindows=“true”, it actually stretches the bottomsheet to behind the statusbar. Removing that line corrects the display.

0reactions
ZacSweerscommented, Mar 11, 2016

@Naveen9453 you are looking for the design support library’s bottomsheet, not this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there any way to draw BottomSheetDialogFragment behind ...
I'm looking for a solution to draw my BottomSheetDialogFragment behind the status bar. I tried to override styles:
Read more >
Show BottomSheetDialogFragment changes status bar color ...
When you show just a simple Dialog the status bar color does not change, the background just gets a little bit dark. I...
Read more >
Bottom Sheet like in a Google Task app | by Alex Fialko
You can see that the BottomSheet is moving under the status bar while it's content is moving down simultaneously.
Read more >
BottomSheetDialog - Android Developers
In edge to edge mode, padding will be added automatically to the top when sliding under the status bar. Padding can be applied...
Read more >
react-native-bottom-sheet-behavior - npm
This component is rendered behind the BottomSheetBehavior, and behave like a parallax when BottomSheet is dragging. you should pass a fixed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found