隐藏对话框的标题栏的Andr​​oid清单 [英] Hiding Dialog's titlebar in Android Manifest

查看:182
本文介绍了隐藏对话框的标题栏的Andr​​oid清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我创建了一个对话框内的活动,全部的寄托似乎是工作完美,但问题是一个对话框的标题栏仍然存在。反正是有隐藏呢?

Basically, I created an Activity inside a dialog, everthing is seems working perfectly but the problem is the title bar of a dialog is still there. Is there anyway to hide it?

和也这是教程,这里是的链接。这正是我试图完成,除了不用其他标题栏。

And also this is the tutorial, here is the link. It is exactly what I am trying to accomplish except witout title bar.

请注意:这不仅仅是一个ALERTDIALOG或对话,这是一个活动内部的对话,其中不仅成为看起来像一个对话框,粘贴下面的code

Note: THIS IS NOT JUST AN ALERTDIALOG OR DIALOG, THIS IS AN ACTIVITY INSIDE A DIALOG which only became looks like a dialog by pasting the code below.

<activity android:label="My Dialog (activity)" android:name=".MyActivity" android:theme="@android:style/Theme.Dialog"></activity>

推荐答案

您可以通过编程删除标题栏。

You can remove the title bar programatically.

将此行添加到您的活动的onCreate()方法。

Add this line to your Activity onCreate() method.

requestWindowFeature(Window.FEATURE_NO_TITLE);

编辑:

创建一个自定义样式,扩展Theme.Dialog:

Create a custom style that extend Theme.Dialog:

&LT;资源&GT;

<style name="NoTitleDialog" parent="android:Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
</style>`

&LT; /资源&GT;

然后引用这个主题在你的活动的android:theme属性。 :)

Then reference this theme in your activity android:theme attribute. :)

这篇关于隐藏对话框的标题栏的Andr​​oid清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆