2017-09-23 9 views
-1

背景がNavbarの下に隠れています。
バックグラウンドをナビバールのすぐ下に表示するにはどうすればよいですか?私の背景はnavbarの下にあります。どのようにnavbarのすぐ下に背景を設定するには?

enter image description here

コード:あなたのactivity_main.xmlで

<ImageView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:src="@drawable/backgroundnew" 
    android:scaleType="centerCrop" /> 
+0

おそらく、それはナビゲーションバーの下にはありません。多分それは切り取られているでしょうか? 'centerInside'スケーリングモードを使うとどうなりますか? –

+0

その作品ですが、背景に白いバーが表示されています:D全画面が必要です – Miche

+0

あなたのコンテンツの後ろにソリッドカラーの背景を設定する方法はありますが、アンドロイドの開発は一度もしていません私はあなたを助けることができないのではないかと心配しています。 –

答えて

0

、あなたは正しくツールバーを閉じたことがありますか?

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      android:fitsSystemWindows="true" 
      app:popupTheme="@style/AppTheme.PopupOverlay"> 
     </android.support.v7.widget.Toolbar> 

     <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     tools:showIn="@layout/app_bar_main"> 

     <FrameLayout 
      android:id="@+id/container" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"/> 
    </RelativeLayout> 
</LinearLayout> 

あなたのツールバーを閉じなかった場合は、ビューが重なっています。

関連する問題