I do it through code.

 requestWindowFeature(Window.FEATURE_NO_TITLE);
 setContentView(R.layout.confirm_dialog);

Here, the layout file contains the title. And then you can override the
Dialog's setTitle and setMessage methods, to update your own text views in
the layout.


Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Wed, Nov 24, 2010 at 12:53 PM, William Ferguson <william.ferguson.au@
gmail.com> wrote:

> That sounds great. How?
> I would normally turn the title off on an Actiivty by setting
>   <item name="android:windowNoTitle">true</item>
> in the style for the Activity. How do I do that for a Dialog?
>
>
>
> On Nov 24, 3:28 pm, Kumar Bibek <coomar....@gmail.com> wrote:
> > You can set the dialog not to have a title(just like turning the
> Activity's
> > title off), and then make your layout have a title bar of your choice. I
> > normally extend the Dialog class and create my own.
> >
> > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
> >
> > On Wed, Nov 24, 2010 at 7:38 AM, William Ferguson <william.ferguson.au@
> >
> > gmail.com> wrote:
> > > Its clearly easy to do, because some many apps do it, but I can't see
> > > how.
> > > I want to display a very simple dialog, with a Title and Content
> > > (eother TextView or perhaps a WebView).
> >
> > > But I want to style the dialog so that the background of the Title,
> > > Content and the dialog window itself are something other than grey.
> >
> > > I've tried constructing a Dialog and setting the ContentView and
> > > Title, but the title always has the grey background.
> >
> > > I've tried using an AlterDialog#Builder, but if I specify the title
> > > string using #setTilte then I have no control over the background. ie
> > > same as for new Dialog above. I also get the grey background of the
> > > dialog window bleeding through above and below the title and content.
> >
> > > I have tried setting a theme for the application that sets the dialog
> > > styles using
> > >        <item name="android:alertDialogStyle">@style/
> > > myAlertDialogStyle</item>
> > > But that doesn't seem to have any effect. Buut then again the doco
> > > that I have found is extremely vague on details, so I probably messed
> > > it up. If you can point me to some clean and coherent doco I'd be
> > > obliged.
> >
> > > The closest I have come is to construct using AlterDialog#Builder and
> > > use both #setContentView and #setCustomTitle as I can style eahc of
> > > those views, but I still have the grey dialog background bleeding
> > > through.above and below the title and content.
> >
> > > Unless someone can point me in the right direction, the only option I
> > > can see is to ditch the Dialog altogether and just create an Activity
> > > that displays the info I want with the styling I want. This is
> > > trivial, but it feels SO wrong. If you can't easily style, what's the
> > > point of the dialogs at all?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> <android-developers%2bunsubscr...@googlegroups.com<android-developers%252bunsubscr...@googlegroups.com>
> >
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> >
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to