底部导航栏隐藏了视图的一部分

And*_*ass 5 android

在我的应用程序中,我想显示一个简单的图像,

在我的三星 Galaxy S7 Real 设备上,图像很好,底部导航栏不是视图的一部分,而是手机本身的一部分。整个图像都存在。

在 Android Emulator 上,底部导航栏是视图的一部分,图像被部分隐藏

这是我的简单线性布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout         
    xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          android:background="@color/md_blue_50"
          android:orientation="vertical">

    <include
        android:id="@+id/app_bar"
        layout="@layout/toolbar"/>

    <ImageView
        android:id="@+id/photo_image_large"
        android:adjustViewBounds="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="fill_vertical"
        android:scaleType="fitXY"/>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

这是安卓模拟器截图

安卓模拟器

这是我的三星 Galaxy 真机屏幕截图

安卓真机

该问题也出现在应用程序中的回收器视图中,图像的底部在 android 模拟器上被切断了...

小智 5

这是因为android:fitSystemWindows把它设置为 false 应该是好的