I searched Stackoverflow and google and I find answers for people who want the fonts to stay the same size, but I want them to get bigger when the screen gets bigger.
In particular, I want very large fonts in my application. On my phone they are 1/2 inch high - perfect. My problem is that they are also 1/2 inch high on my 7 inch tablet, and I want them to grow to be about 1 inch. I tried sp and dp modes, and both just keep fonts of the same physical height, which I don't want. I see that for tablets with 3.2 and higher, there is something new, but I want to support devices from 2.3 and higher. I saw complex code that says it automatically scales the fonts to fit the text in width, but this is not what I need. I want fonts to be equivalent to 100sp on a phone and 200sp on a tablet. I do not have graphics and simple relative layouts with very few elements on the screen.I just need to make some text files bigger for larger screens. I would have thought it would be easy, but I cannot find it.
Here is a typical text entry
<TextView
android:id="@+id/textDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/labelDistance"
android:layout_centerHorizontal="true"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff"
android:textSize="100sp" />
Is there a relatively simple direct way to do this?
source
share