如何更改自定义对话框的高度';Android中的标题栏

如何更改自定义对话框的高度';Android中的标题栏,android,titlebar,Android,Titlebar,在我的android应用程序中,我有一个自定义对话框。我想设置对话框标题栏的高度。我的风格如下: <resources> <style name="customDialogStyle" parent="android:Theme.Dialog"> <item name="android:background">#04a9ee</item> <item name="android:height">

在我的android应用程序中,我有一个自定义对话框。我想设置对话框标题栏的高度。我的风格如下:

<resources>
    <style name="customDialogStyle" parent="android:Theme.Dialog"> 
        <item name="android:background">#04a9ee</item>
        <item name="android:height">5dp</item> 
     </style> 
</resources>

#04a9ee
5dp

但标题栏上的“height”属性不起作用。那么,如何更改自定义对话框标题栏的高度呢?

是的,我刚刚检查了一下,您想使用
“android:layout\u height”
其他可以使用的高度,如:
“android:minHeight”
这对我很有用

你的主题:

  <resources>
       <style name="MyDialog" parent="android:Theme.Holo.Dialog">
           .......

       </style>

  </resources>
创建对话框并在代码中显示:

   CustomDialog customDialog = new CustomDialog(this, R.style.MyDialog);
   customDialog.show();

我试过“android:layout_height”和“android:minHeight”,但标题栏的大小没有变化。这些属性会对对话框或其标题栏产生影响吗?。在我的情况下,什么都没有发生如果您不能以本机方式更改对话框中标题栏的高度,则必须创建自己的视图,并将对话框的视图设置为自定义视图。可以这样做:
   CustomDialog customDialog = new CustomDialog(this, R.style.MyDialog);
   customDialog.show();