Android 在actionBar中设置customView

Android 在actionBar中设置customView,android,android-actionbar,android-ui,android-custom-view,Android,Android Actionbar,Android Ui,Android Custom View,我正在写一个视图来设计我的应用程序的ActionBar,虽然它在纵向上工作得很好,但在横向上它会剪辑一条固定在底部的线?是因为ActionBar被指定了一定的高度,而我的自定义视图比这个大吗?以下是我的自定义视图的XML: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_

我正在写一个视图来设计我的应用程序的ActionBar,虽然它在纵向上工作得很好,但在横向上它会剪辑一条固定在底部的线?是因为ActionBar被指定了一定的高度,而我的自定义视图比这个大吗?以下是我的自定义视图的XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#252525" >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:src="@drawable/ac_logo" />

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/imageView1" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="2dp"
        android:layout_weight="1"
        android:background="#F0C46C" >
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="2dp"
        android:layout_weight="1"
        android:background="#FFFFFF" >
    </LinearLayout>
</LinearLayout>

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:scaleType="fitXY"
    android:src="@drawable/ac_text" />

好吧,我想出来了,我会发布它,以防万一它能帮助任何碰巧看到这一点的人:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#252525" >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentBottom="true"
    android:src="@drawable/ac_logo" />


<ImageView
    android:id="@+id/imageView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:scaleType="fitXY"
    android:src="@drawable/ac_text" />

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView1">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="2dp"
        android:layout_weight="1"
        android:background="#F0C46C" >
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="2dp"
        android:layout_weight="1"
        android:background="#FFFFFF" >
    </LinearLayout>

</LinearLayout>