Android 使用Sherlock动作栏的自定义动作栏

Android 使用Sherlock动作栏的自定义动作栏,android,android-actionbar,actionbarsherlock,Android,Android Actionbar,Actionbarsherlock,我以这种方式使用Sherlock创建了一个自定义ActionBar 动作条。我的自定义布局文件 <?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="match_parent

我以这种方式使用Sherlock创建了一个自定义ActionBar 动作条。我的自定义布局文件

<?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="match_parent"
    android:orientation="vertical"
    android:layout_gravity="fill_horizontal" >

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:background="@color/brown">

        <TextView
            android:id="@+id/textView1"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_weight="9"
            android:text="Add Modules"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/addbutton" />

    </LinearLayout>


</RelativeLayout>
我的新布局中的问题对于某些设备来说仍然是可见的黑色旧背景。布局与屏幕不匹配


要删除默认背景,可以使用

 getSupportActionBar().setBackgroundDrawable(null);

要删除这三个点,请删除创建选项菜单上的
onCreateOptionsMenu

,选项菜单按钮也会出现。如何删除此项尝试删除创建选项菜单中的
我尝试了getSupportActionBar().setBackgroundDrawable(null);黑色已取消显示,但版面仍在创建选项菜单中删除,并更改了android:layout\u height=“match\u parent”。现在它起作用了
 getSupportActionBar().setBackgroundDrawable(null);