Android examples for User Interface:TextView
Return the width of the TextView.
import android.widget.TextView; public class Main { /**//from w ww . j a v a 2 s . c o m * Return the width of the testText. * * @return the width of testText placed in the textView */ private static float getTextSize(TextView textView, String testText) { return textView.getPaint().measureText(testText); } }