Android 自定义标题栏被其他布局截断

Android 自定义标题栏被其他布局截断,android,custom-titlebar,truncated,Android,Custom Titlebar,Truncated,我使用以下3行定义了自定义标题栏: requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(view); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title); 正如在许多文章中解释的那样,标题栏被我设置的内容视图截断,我只看到了它的一部分。 我试图在我设置的布局中添加边距顶部,但没有效果 主要布局: <Line

我使用以下3行定义了自定义标题栏:

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(view);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
正如在许多文章中解释的那样,标题栏被我设置的内容视图截断,我只看到了它的一部分。 我试图在我设置的布局中添加边距顶部,但没有效果

主要布局:

<LinearLayout 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:layout_gravity="right 
android:background="@color/bgColor" 
android:gravity="right" 
android:orientation="vertical">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="277dp"
    android:layout_gravity="right"
    android:gravity="right" >

...

您可以显示屏幕截图吗?您可以在这里看到:黑色标题栏的大小(高度)约为其实际大小的一半。您可以显示自定义版面的版面文件代码吗?请向我们显示完整的版面?很难理解如何将这些部分连接在一起。我上面发布的主布局只是有一些嵌套布局、EditText、TextView等。没有什么特别的。。。我使用上面写的代码设置标题和适当的布局(我有多个,我在它们之间切换),但是我使用LayoutInflater来查找我想要显示的布局,因此代码比我发布的3行代码要复杂一些,但基本上我只使用setContentView,我想这是相关的代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="55dp"
android:background="#323331"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="5dip" >

<ImageView
    android:id="@+id/header"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="right"
    android:layout_weight="0.95"
    android:scaleType="fitCenter"
    android:src="@drawable/logo1" />