Public class SetParamActivity extends AppCompatActivity {
@ Override
Protected void onCreate (Bundle savedInstanceState) {
MyDrawView myView=new myDrawView (this);
The setContentView (myView);
}
Public class myDrawView extends the View {
@ Override
Protected void ontouch (Canvas, Canvas) {
}
,,,,,,,
}
}
However, in this way, can't add other controls in the myView, excuse me how to operate?
CodePudding user response:
The setContentView you replace the original with your custom, original, of course, does not show,CodePudding user response:
You can be in the original XML to add a custom view or in Java code addView (your custom view)