so i made a Surface view with a canvas, so i could do some graphics. is there any way of having a xml layout with a canvas, so i can have buttons and what not on the screen, or is there any other option to making buttons on a canvas?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will have to made one class that having that canvas in it. And then Import that class in the xml layout.
See this example: FingerPaint Example.
In above example there is myView class that contain the canvas to draw on it.
What you need to do is:
First Create any Layout in your xml as like below:
Now let say main.xml is your main xml layout file then add that class in to that layout as like below:
Hope you got the point. If not then let me know.
Enjoy. :))