所以,我已經看到了幾個填充是自定義標題欄中的問題的實例,但這似乎是獨一無二的,我很想看看是否有人可以對此進行說明。Android - 標題欄隱形填充
這是我有:
有填充,以配置按鈕不應該是正確的。我最後需要一些填充,但爲了證明一點,這是沒有填充集。這是自定義標題欄的佈局。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFF" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/titleImage"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="8dip"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:src="@drawable/icon" />
<TextView android:id="@+id/customtitlebar"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="COMPANY"
android:textSize="20dip"
android:textColor="#205cc7"
android:textStyle="bold"
android:paddingTop="15px" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:src="@drawable/configure" />
</LinearLayout>
</RelativeLayout>
我想也許佈局我給了一個虛擬ID「容器」中被切斷,以及和這個問題是這樣的佈局之外,但是,當我改變它的背景爲紅色,它佔據了整個屏幕。
沒有人有隱藏OS標題欄,並使其成爲一個標題爲每個屏幕布局的解決方案短?
您必須重新設計該標題,因爲它是複雜現在實施它的方式。你在一個'RelativeLayout'裏,你爲什麼不使用它? – 2011-04-05 19:27:39