KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I draw a button on top of the canvas in a custom view? (Preferably on the mid-right side) Is there something I have to call before doing the button.draw(canvas)? public class MyClass extends View { public Simulation(Context context) { super(context); pauseButton.setText("TestButton"); pauseButton.setClickable(true); pauseButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Log.i(TAG, "Button Pressed!"); } }); public onDraw(Canvas canvas) { super.onDraw(canvas); pauseButton.draw(canvas); } } Thanks for your time
Tags (comma-separated)
Save Edits
Cancel