Chris Banes
Home
Me
Talks
Text
Text
,
Android Views
Measuring Text
If you start manually drawing things to Android’s Canvas [https://developer.android.com/reference/android/graphics/Canvas.html], you will probably start to draw text as well. When doing so you need to know where to position the text when you draw, and to do that you will need to measure the text before drawing it, to compute the starting x/y values. -------------------------------------------------------------------------------- In an app recently I needed to draw some text centered both ver