¡@

Home 

2014/10/16 ¤W¤È 08:25:39

android Programming Glossary: targettextsize

Auto Scale TextView Text to Fit within Bounds

http://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds

set use the lesser of that and the default text size float targetTextSize mMaxTextSize 0 Math.min mTextSize mMaxTextSize mTextSize Get.. height int textHeight getTextHeight text textPaint width targetTextSize Until we either fit within our text view or we had reached our.. incrementally try smaller sizes while textHeight height targetTextSize mMinTextSize targetTextSize Math.max targetTextSize 2 mMinTextSize..

Auto Scale TextView Text to Fit within Bounds

http://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds

textPaint.getTextSize If there is a max text size set use the lesser of that and the default text size float targetTextSize mMaxTextSize 0 Math.min mTextSize mMaxTextSize mTextSize Get the required text height int textHeight getTextHeight text.. mTextSize mMaxTextSize mTextSize Get the required text height int textHeight getTextHeight text textPaint width targetTextSize Until we either fit within our text view or we had reached our min text size incrementally try smaller sizes while textHeight.. fit within our text view or we had reached our min text size incrementally try smaller sizes while textHeight height targetTextSize mMinTextSize targetTextSize Math.max targetTextSize 2 mMinTextSize textHeight getTextHeight text textPaint width targetTextSize..