I add a Button and TextView in my program,
which I set them on the same row.
Then I try to add a canvas on the second row,
However it somehow cover my button and TextView on the first row.
Here's my code from MainActivity.java, onCreate() method:
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("DotSmasher");
canvas = new DotSmasherCanvas(getBaseContext());
//some other codes here
//Toggle button
toggleButton = (ToggleButton) findViewById (R.id.toggleButton);
toggleButton.setText("Stop");
toggleButton.setOnCheckedChangeListener(this);
layout = (RelativeLayout) findViewById(R.id.layout);
layout.addView(canvas);
layout.setPadding(0,0,0,0);
textSec = (TextView)findViewById(R.id.textSec);
//Rest of codes here
This is my activity_main.xml:
I want to add canvas below those two items (Button and TextView).
How should I do that?