2

I have the following situation: I want to draw an rectangle on a canvas and inside the rectangle a text of a certain size. How can I make the rectangle have 1/4 width of the screen on all screen sizes, and how can I know what setTextSize to give to the inside text in order to not exceed the rectangle boundaries ? I have read http://developer.android.com/guide/practices/screens_support.html but I'm not fully clear with the concepts.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171
Alex
  • 2,213
  • 4
  • 32
  • 44
  • funny... :) Actually (if you can believe it) no, I just want to know from someone that has some experience what are the general guidelines when working with canvas in order to achieve the same results on all display types. – Alex Feb 01 '11 at 05:58
  • Can you please update us if you have found a way ? – m4n07 Oct 18 '11 at 06:10
  • Read my answer here: http://stackoverflow.com/questions/8625208/working-with-canvas-in-different-screen-sizes/8626456#8626456 It's actually about HTML5 Canvas and not the android canvas but the same idea should apply. – Simon Sarris Jun 03 '12 at 04:17

0 Answers0