如何更改 Android 中自定义对话框标题栏的高度
在我的 Android 应用程序中,我有一个自定义对话框。我想设置对话框标题栏的高度。我的风格如下:
<resources>
<style name="customDialogStyle" parent="android:Theme.Dialog">
<item name="android:background">#04a9ee</item>
<item name="android:height">5dp</item>
</style>
</resources>
但是标题栏上的“高度”属性没有效果。那么,如何改变自定义对话框标题栏的高度呢?
In my android app I have a custom dialog box. I want to set the height of dialog's Title bar. My style is as follows:
<resources>
<style name="customDialogStyle" parent="android:Theme.Dialog">
<item name="android:background">#04a9ee</item>
<item name="android:height">5dp</item>
</style>
</resources>
But there is no effect of "height" attribute on title bar. So, how can the height of custom dialog's title bar can be changed ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,我只是检查一下,您想使用
"android:layout_height"
您也可以使用其他高度,例如:"android:minHeight"
Yeh I just check, you want to use
"android:layout_height"
other heights you can use also like:"android:minHeight"
这对我有用
你的主题:
你的自定义对话框类:
创建对话框并在代码中显示:
This works for me
Your theme:
Your Custom Dialog Class:
Create dialog and show in your code: