我已經建立了一個新的Android工具欄:Android父視圖:如何減少工具欄的大小?
android:layout_height="?attr/actionBarSize"
工具欄在屏幕頂部顯示正確。我遇到的問題是應用程序屏幕其餘部分的背景圖像頂部被工具欄覆蓋。我需要通過佈局文件中工具欄的高度來減小容納背景圖像的容器的高度,但是沒有任何運氣。
工具欄顯示正確。它有一個圖像作爲背景。
下面是main.xml中的文件:
<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="wrap_content"
android:background="@drawable/big_wave"
tools:context=".MainActivity" >
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:background="@drawable/actionbar_skypic" />
</RelativeLayout>
飼養背景,在工具欄上透明也將正確解決問題了嗎? – 2015-03-03 07:20:00