Hi All,
How can i draw a view on a canvas by giving the x,y position in the canvas.
For example,
I have custom view myView, which was created by inflating one of my layout.xml file.
Now i want to draw this myView on the canvas at position (x, y).
How can i do that?
Please help with your ideas.
Thanks,
Sen
Updated:
To be more specific,
I have myView extend view {
...
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
{ Inside which i will draw a curve }
Then I will obtain 8 set of co-ordinates along the path and will store it in a list.
Then i have created a new view by using Absolute layout and its name is myinfo.xml(which contains two text views) present inside the res/layouts folder.
Now i want to inflate this view inside the onDraw method and want to place them in the above collected co-ordinates.
But i tried to inflate the view in this class(myView) but it is not working.
Please tell where am i wrong??
If you have some other suggestion, do update me.
Thanks & Regards,
Sen