1

I am working on android application in which i want to set my text size according to the screen. I am using the following method, but it is not re-sizing my text size according to the screen.

myRequestText.setTextSize(convertFromDp(21));//myRequestText is a textview
public float convertFromDp(int input) {
        final float scale = getResources().getDisplayMetrics().density;
        return ((input - 0.5f) / scale);
    }
Usman Khan
  • 3,739
  • 6
  • 41
  • 89
  • refer this http://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds – Shijil Dec 16 '14 at 10:39

0 Answers0