所以,我已经看到了几个填充是自定义标题栏中的问题的实例,但这似乎是独一无二的,我很想看看是否有人可以对此进行说明。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