0

I am trying to draw 3 lines real time, whose co-ordinates are constantly updating. In this link, How to draw a line in android, it is explained how to draw lines, but they take up all of the screen. How do I get it to take up only part of the screen, and let my layout main file take up the rest. Is this possible?

Thanks,

Rokky

Community
  • 1
  • 1
Rokky100
  • 67
  • 6

1 Answers1

0

If you wish to dynamically create the DrawView, as your example shows, 1cCreate a view (perhaps a FrameLayout) within your layout xml which will hold your canvas, and use standard Android layout techniques to make the FrameLayout be the right size.

Alternatively you can create the DrawView statically by placing it directly in your layout; How to add CustomView to Layout fromXML? shows how to do that.

Community
  • 1
  • 1
mah
  • 37,085
  • 9
  • 70
  • 91