2017-03-22 57 views
2

在我的應用我想顯示一個簡單的圖像,底部導航欄隱藏了一個視圖

在我的三星Galaxy S7實際設備的圖像是罰款的一部分,底部導航欄是不看法,但部分的一部分的電話本身。 整個圖像存在。

在Android模擬器底部導航欄是視圖的一部分,並且圖像被部分隱藏

這是我的簡單線性佈局

<?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> 

這裏是Android模擬器截圖

android emulator

這是我的三星Galaxy Real設備屏幕截圖

android real device

的問題也發生在回收意見在應用程序中的圖像的底部被切斷對Android模擬器......

回答

0

你必須把底部的導航欄上方的視圖,以便該視圖不會隱藏在底部導航欄

+0

但底部導航欄是不是該視圖的甚至一部分 - 請參考我的LinearLayout ... –

+0

是的,我瞭解它的一個Android模擬器它不是真正的設備,所以沒有問題,當你把應用程序放在商店 –

+0

剛試過android:fitsSystemWindows =「false」圖像仍然是相同的 –

2

這是因爲android:fitSystemWindows把它放到假的,它應該是不錯的

0

我有類似的問題BottomNavigationView(菜單),這是解決方案:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/main_activity_main_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

<FrameLayout 
    android:id="@+id/main_activity_container" 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1"> 
</FrameLayout> 


<android.support.design.widget.BottomNavigationView 
    android:id="@+id/navigation" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="start" 
    app:itemIconTint="@color/color_main_white" 
    app:itemTextColor="@color/color_main_white" 
    app:menu="@menu/bottom_navigation_menu"/> 

嘗試改變參數的android:layout_heigh到0dp並添加這個機器人:layout_weight =「1」的ImageView