• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How do I "add" a canvas to a linear layout?

I'm writing an app that will graph a line. The user enters two points and the app draws and displays a line. The math I can figure out, but I am completely confused on how to use a canvas. I'm just using a basic linear layout with a couple edittexts and a button. Below that I need to display the canvas. All I am trying to do now is add that canvas below my edittexts and then draw a vertical line on it. How do I do this?
 
Wrap your current LinearLayout with a RelativeLayout and place your canvas directly inside the RelativeLayout. Use the android:below attribute in your Canvas definition to place the canvas below the LinearLayout.
 
Back
Top Bottom