Take a look at this:
http://developer.android.com/resources/tutorials/views/hello-gallery.html

This uses ImageViews, but you should be able to replace those with your
custom view...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 29, 2011 at 6:07 PM, raazgul <nixa...@gmail.com> wrote:

> I am trying to create a custom view object that I can display on the
> screen. I have been able to display the object but and I now trying to
> add this view to a gallery type thing so that I can horizontally
> scroll through a few of them. I am wondering if I can just add them
> directly to the gallery somehow or do I have to construct a new class
> that would extend a gallery view. I am unsure on how to do either one
> of these and would like any assistance you are willing to give.
>
> The custom view that I created is below. I have not done much on the
> visual aspect of this project because I am unsure about custom views.
> ********************************************************************
> class Domino extends View {
>
>    public Domino(Context context) {
>        super(context);
>    }
>
>    @Override
>    public void onDraw(Canvas canvas) {
>        Bitmap _dom = BitmapFactory.decodeResource(getResources(),
> R.drawable.domino_image);
>        canvas.drawColor(Color.BLACK);
>        canvas.drawBitmap(_dom, 20, 20, null);
>    }
> }
> ********************************************************************
> I know by using the drawBitmap() method I am just drawing all images
> on top of each other.
>
> --
> 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

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