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>
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"/>
精彩评论