I am using in ImageButton Now and am using the following code to ad the
button to the surfaceview..

myImgTest.setBackgroundDrawable(mBalloon1);

myImgTest.draw(canvas);
This seems to work as I do not get any errors however i don't see the
button. What is the proper way to add the button to the surface view and how
do I specify cordinates?




On Sun, Mar 29, 2009 at 11:41 PM, Marco Nelissen <marc...@android.com>wrote:

>
> Your Drawable itself is not part of the UI, but is drawn onto
> something that is part of your UI. Therefore, you should attach your
> listener to the UI object that displays the Drawable.
> See also
> http://developer.android.com/reference/android/graphics/drawable/Drawable.html
> ,
> which says "Unlike a View, a Drawable does not have any facility to
> receive events or otherwise interact with the user. "
>
>
>
> On Sun, Mar 29, 2009 at 10:24 PM, Josh <joshdo...@gmail.com> wrote:
> >
> > I currently have a drawable and i need to know when it's clicked. Is
> > there a way to add an event listener to a drawable?
> >
> > I realize that there may be a better control to use for me needs so I
> > tried ImageButton but Im a bit confused on how to position the
> > ImageButton. For example whe i position the drawable i just use
> > setBounds. Is there a way to specify the x and y coordinates for an
> > image button?
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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