0

When I start my application, a few second after everything loads, the toolbar is appearing and everything moves a little up. I don't know why this is happening.

Toolbar

That's my layout.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".views.main.MainActivity">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/drawer_toolbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <FrameLayout
        android:id="@+id/container_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <FrameLayout
        android:id="@+id/loader_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/loaderBackground"
        android:visibility="gone" />

</RelativeLayout>

On my phone with resolution 2340 x 1080 everything is working properly, but on phone with resolution 720 x 1440, it isn't working properly. I tried with other resolutions and it's not working still. I start thinking that the resolution isn't the reason for this bug. You can see on the screenshot above.

<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorPrimary</item>
    </style>
user8549135
  • 59
  • 1
  • 10

0 Answers0