Tell me, how can I make text in Android, like in the picture? Ie that the rubles were "big" and pennies were higher and small
2 answers
Just add html tags to the string resources:
<string name="price"><big>1</big><sup><small>99</small></sup></string>
<big>
makes the text larger than the standard.<small>
makes the text smaller than the standard.<sup>
lifts above the line.
Ps. In the layout viewer, the formatting will not be visible (I don’t know why), but the application will display as it should.
|
You can try to split the price on 2 TextView
and set styles for them. For example:
<style name="Rub"> <item name="android:textSize">18pt</item> </style> <style name="Kop"> <item name="android:textSize">6pt</item> <item<name="android:paddingBottom">20dp</item> </style> <!-- Размеры шрифта и отступов, если, что подгоните. -->
Also, if my memory serves me, TextView
understands simple HTML markup.
|