Android Activity 作为对话框,但没有标题栏 [英] Android activity as dialog, but without a title bar
本文介绍了Android Activity 作为对话框,但没有标题栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个活动,其主题设置如下:
I have an activity that has the following set as theme:
android:theme="@android:style/Theme.Dialog"
但是,出现的活动对话框中有一个标题栏,它占用了我仅有的少量可用空间.我怎样才能删除它?
However, there is a title bar in the activity-dialog that appears, that uses up the little available space that I have. How can I remove it?
推荐答案
在onCreate
中尝试做requestWindowFeature(Window.FEATURE_NO_TITLE);
.它需要在调用 super.onCreate
之后和 setContentView
之前立即完成.
Try doing requestWindowFeature(Window.FEATURE_NO_TITLE);
in onCreate
. It'll need to be done immediately after calling super.onCreate
and just before setContentView
.
这篇关于Android Activity 作为对话框,但没有标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文