Shripal
Shripal

Reputation: 55

Android: android.app.Dialog.setTitle() doesn't show title of dialog

I am using android.app.Dialog and using setTitle("title"); method but it doesn't show the dialog title bar. I have also used the following style for that activity in menifest file.

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

May be this style automatically applies for dialog as well. How can I show the title bar without changing the windowNoTitle to false? I also don't want to use AlertDialog instead of Dialog.

Upvotes: 0

Views: 179

Answers (1)

Newbie Android
Newbie Android

Reputation: 389

You need to change your style to Check this style may be this will work.

 <style name="picture_dialog_style" parent="@android:style/Theme.Holo.Dialog.NoActionBar">
    <item name="android:windowFrame">@null</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowIsTranslucent">false</item>
    <item name="android:windowNoTitle">false</item>
    <item name="android:background">@android:color/white</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:backgroundDimEnabled">true</item>
    <item name="android:textColor">@color/colorOrange</item>
    <!--<item name="android:windowAnimationStyle">@style/PauseDialogAnimation</item>-->
</style>

Upvotes: 1

Related Questions