Rob
Rob

Reputation: 51

Create a drawable canvas inside an XML layout

I am new to Java and android, so I don't know if it's possible, but I would like to create a dynamically drawable surface/view/place in my app. I know how to replace my whole XML layout with a drawable canvas, but that's not what I want. I would prefer this drawable surface to be on top of (or in) my static layout and I still haven't found out how to do that. Below an illustration of what I mean:

example app

Thanks in advance!

Upvotes: 1

Views: 1370

Answers (1)

Mohamed_AbdAllah
Mohamed_AbdAllah

Reputation: 5322

You have different options. You can put a custom View and override its onDraw() method to draw with its Canvas. Another option is to use SurfaceView (which provides a Thread for drawing with its Canvas, more efficient for more complex drawing). Here is more details about for the first option and second option.

Upvotes: 1

Related Questions