Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why textStyle italic is not applied in Android layout for other typefaces than serif?

Below is the simple xml snippet for which android:textStyle="italic" is not applying.

If I remove android:textStyle="italic the text will appear.

<TextView
    android:text="row one"
    android:textSize="15pt"
    android:typeface="serif"
    android:textStyle="italic"
    android:textColor="#00abcd"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"/>

In the above android:textStyle="italic" is working only for android:typeface="serif", if I change the typeface to sans, monospace or normal the android:text is not displaying.

Why is that?

like image 326
Vins Avatar asked May 11 '11 11:05

Vins


1 Answers

try making text italic through strings file it is alternative to this might help you

example

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="Row_one"><i>Row one</i></string>
    <string name="Row_two"><i>Row two</i></string>
</resources>
like image 191
UMAR-MOBITSOLUTIONS Avatar answered Sep 30 '22 08:09

UMAR-MOBITSOLUTIONS