让EditText不自动获取焦点

在EidtTest的上级控件中,设置:

android:focusable="true"
android:focusableInTouchMode="true"

获取字符高度

float textHeight = mTextPaint.descent() - mTextPaint.ascent();

获取字符宽度

float textWidth = mTextPaint.measureText(mTextContent + "");

确定字符的基准坐标

float textBaseX =  getPaddingLeft() + (size - getPaddingLeft() - getPaddingRight()) / 2;
float textBaseY = size / 2 - (mTextPaint.descent() + mTextPaint.ascent()) / 2 + delta;
2016-10-29 10:0518