0

How to access the title of the dialog to change the typeface font ( to create a custom title of dialog) ?

Charles
  • 50,943
  • 13
  • 104
  • 142
Adham
  • 63,550
  • 98
  • 229
  • 344
  • Is it necessary to change existing title style (I don't know if that's possible)? But could you create totally custom dialog layout containing custom title instead and hide default title altogether? – harism Aug 29 '12 at 18:12
  • how to hide the default title ??? – Adham Aug 29 '12 at 18:19
  • ``Dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)``. Alternatively you could do some searching on ``FEATURE_CUSTOM_TITLE``, there are some examples on how to switch title layout only. – harism Aug 29 '12 at 18:24

1 Answers1

-1

You can't do it. You must use a activity and set its theme to dialog. like this

<activity android:theme="@android:style/Theme.Dialog" />

when you start your activity it's start as a dialog and setTypeFace in your xml layout file or set it programmatically. If you don't want to have a Title set this code :

requestWindowFeature(Window.FEATURE_NO_TITLE);

It'll need to be done immediately after calling super.onCreate.

AliSh
  • 10,085
  • 5
  • 44
  • 76