[android-developers] Re: custom dialog frame - how to get a pointy triangle edge
Getting much closer. But not quite. I've got my customized background
(nine patch) built and assigned to the alert window. But, its huge
while the dialog list items are normal size. I did
alert.getWindow().setLayout(50, 50) to resize that window but it has
no effect. Still have this huge background and small dialog
contents. Must be missing something big here.
Here is my Dialog display code:
mAlert = builder.create();
mAlert.requestWindowFeature(Window.FEATURE_NO_TITLE);
mAlert.getWindow().setLayout(50, 50);
// *** this is the nine patch (looks
beautiful by the way, just huge)
mAlert.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.eight));
// ***
mAlert.show();
On Apr 2, 4:16 pm, Nick Longinow <nicklongi...@gmail.com> wrote:
> Successfully got a .9.png file created and applied it to my ListView -
> looks very nice. Problem - the AlertDialog I want to use it for seems
> to add a rectangle with white interior as a container or border around
> my ListView. I'd like it to be transparent, and only show the
> ListView. Do I have to do an "extends alertdialog" class to get rid of
> that white border?
>
> On Mar 30, 6:21 pm, Nick Longinow <nicklongi...@gmail.com> wrote:
>
>
>
> > Then that's what I'll do. Moving the triangle around randomly isn't
> > very important. Thanks all.
>
> > On Mar 29, 10:29 pm, Dianne Hackborn <hack...@android.com> wrote:
>
> > > No, use a 9-patch. That said, if you want to actually position the triangle
> > > at different places in the border you probably will need to give up on just
> > > setting a custom background drawable and have to draw your own background
> > > with things positioned where you want.
>
> > > On Tue, Mar 29, 2011 at 6:06 PM, Nick Longinow <nicklongi...@gmail.com>wrote:
>
> > > > I'm looking for something more like a <shape> where the vertices are
> > > > set to like a rectangle, but with one side that has a triangle shape
> > > > coming out of it. I believe I create this as a drawable in the XML
> > > > layout, and then set the Dialog to use this drawable as the
> > > > background. True so far?
>
> > > > On Mar 27, 11:01 pm, Hari Edo <hari....@gmail.com> wrote:
> > > > > If you mean like the SMS app, you can do that with a .9.png
> > > > > image file, also called a "Nine Patch."
>
> > > > >http://developer.android.com/guide/topics/graphics/2d-graphics.html#n...
>
> > > > > On Mar 27, 10:34 pm, Nick Longinow <nicklongi...@gmail.com> wrote:
>
> > > > > > Like a balloon-style dialog, with one side of the dialog having a
> > > > > > triangle coming out of it so that the dialog appears to point to some
> > > > > > portion of the screen. I've seen these in alot of apps - what is the
> > > > > > basic idea here? Is it use of shapes and themes? Any simple examples
> > > > > > out there?- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > --
> > > > 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+unsubscribe@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails. All such
> > > questions should be posted on public forums, where I and others can see and
> > > answer them.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home