当我启动应用程序时,所有内容加载几秒钟后,工具栏出现,并且所有内容略微向上移动。我不知道为什么会这样。
这是我的布局。
<?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>
在分辨率为2340 x 1080的手机上,一切正常,但是在分辨率为720 x 1440的手机上,一切均不正常。您可以在上面的屏幕截图中看到。
<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>