2017-12-24 8 views
2

私のアプリではこの奇妙な問題が発生しています。私はandroid:fitsSystemWindows="true"と画像ビューを持って、それがステータスバーの後ろに来てほしい。画像ビューのバックグラウンドとsrc属性の動作が異なります

android: backgroundを使用すると、次のように正しく動作します。

enter image description here

[ステータスバーに青色の背景に気づく]しかし、私はsrc属性を使用する場合、それは、ステータスバーの後ろに行きません。

enter image description here

私は何かが足りないのですか?ヘルプは高く評価されます。

ここは自分のアクティビティXMLです。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:openDrawer="start"> 

    <ImageView 
     android:id="@+id/full_background" 
     android:fitsSystemWindows="true" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/colorPrimary" 
     android:scaleType="centerCrop" 
     android:contentDescription="full_background" 
     tools:ignore="HardcodedText" /> 

    <include 
     layout="@layout/app_bar_activity_main" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

    <android.support.design.widget.NavigationView 
     android:id="@+id/nav_view" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     app:headerLayout="@layout/nav_header_activity_main" 
     app:menu="@menu/activity_main_drawer" /> 

</android.support.v4.widget.DrawerLayout> 
+0

を外部に拡張することができ、あなたのテーマのウィンドウtranslucentstatusで同じ問題 –

+0

が真か偽である、試してみました? –

+0

それは本当ですが、それを試しても試してみても同じ問題が残る –

答えて

0

使用してみてください:FLAG_LAYOUT_NO_LIMITS ITは、ウィンドウが画面の

Window window = getWindow(); 
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); 
+0

これは機能しましたが、ステータスバーの下にツールバーが表示されました。 : –

+0

okk、私はそれを持っていると思う、すべてのアンドロイドを削除する:fitsSystemWindows = "true" imageview以外 –

+0

いいえ、うまくいけなかった、私はこの問題についてもっと研究しなければならない –

関連する問題