Search code examples
androidxamarin.androidondraw

OnDraw Android (monodroid)


Can someone explain to me how to implement the onDraw function. I also like to know When is this function called. (i'm using Monodroid so if it could be explained using c# examples)

I'm trying to make a custom view with a graph on it (on a canvas) but it all points to it that i need to implement the onDraw function.

So if someone can make that clear to me :)


Solution

  • onDraw() is called when you call invalidate().

    I suggest you search for tutorials on how canvases work. Here's a place to get you started: http://developer.android.com/guide/topics/graphics/2d-graphics.html