Toolbar Overlapping Below Status Bar

Toolbar overlapping below status bar

Use android:fitsSystemWindows="true" in the root view of your layout (LinearLayout in your case).

Toolbar overlaps Translucent status bar

add android:fitsSystemWindows="true"

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
tools:context="com.aminiam.moviekade.fragment.AllReviewFragment">

Why toolbar is getting under the android system status bar (please check the screenshot)?

Add below link into your parent xml tag which is CoordinatorLayout in your case. Toolbar will appear below the status bar.

android:fitsSystemWindows="true"

Flutter toolbar overlapping below status bar

Actually, the appbar is partially under the status bar. It just has an internal padding to handle it correctly

This is very clear when you remove the appbar :

Scaffold(
body: Text("Hello"),
)

In this situation, it will render "Hello" under the status bar.

You can fix this by wrapping your body into a SafeArea :

Scaffold(
body: SafeArea(
child: Text("Hello"),
),
),

Toolbar overlaps status bar

Try add android:fitsSystemWindows="true" to android.support.design.widget.AppBarLayout or @style/AppTheme.PopupOverlay style

Toolbar overlaps below status bar

I think it's a bug...Then i tried to set the statusBarColor in style.xml,and it worked!
Try this in style.xml v21

<item name="android:statusBarColor">?colorPrimaryDark</item>

Hope it can fix your problem.

Android - Toolbar under status bar in CoordinatorLayout in Fragment

I had the same issue.
Put:

android:fitsSystemWindows="true"

in the root of your Activity's layout(the Activity that contains the fragment), not in the root of the fragment's layout(in your case the CoordinatorLayout).



Related Topics



Leave a reply



Submit