开发者

Hiding Dialog's titlebar in Android Manifest

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.

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>

Hiding Dialog's titlebar in Android Manifest


If ur using appcompat support v4, v7 libraries then try using

supportRequestWindowFeature(Window.FEATURE_NO_TITLE);

before setContentView and also before super.Oncreate();


You can remove the title bar programatically.

Add this line to your Activity onCreate() method.

requestWindowFeature(Window.FEATURE_NO_TITLE);

Edit:

Create a custom style that extend Theme.Dialog:

<resources>

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

</resources>

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


I came up with such, easiest solution: In Manifest android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar"> Seems to work.


Try this :

style.xml

<style name="NoTitleActivityDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="windowNoTitle">true</item>
</style>

AndroidManifest.xml

   <activity
        android:name=".DialogActivity"
        android:theme="@style/NoTitleActivityDialog"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜