Snake
Snake

Reputation: 14678

Italics not working

I have my simple XML file and I set the android:typeface to italic. However, when I do that, I want:

  1. text field disappears from editor
  2. during running on device the text appears normal (not italic)

Is the italic no longer supported or is there something specific I should do?

EDIT

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center_horizontal" android:orientation="vertical">
        <LinearLayout android:id="@+id/layoutHeader" android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <include android:id="@+id/myHeader" layout="@layout/custom_property_row_view" />

    </LinearLayout>

    <ListView android:id="@+id/lvProp" android:layout_width="fill_parent" android:layout_height="wrap_content"></ListView>
      <TextView android:id="@+id/tvEmptyTasks" android:layout_width="wrap_content" android:layout_height="wrap_content" 
        android:text="There are no Tasks added!" android:visibility="invisible" android:textStyle="italic"/>

</LinearLayout>

Upvotes: 0

Views: 1327

Answers (2)

Androyds
Androyds

Reputation: 491

textView.setTypeface(null, Typeface.BOLD_ITALIC);
textView.setTypeface(null, Typeface.BOLD);
textView.setTypeface(null, Typeface.ITALIC);

Code behind

Upvotes: 0

Ahmad
Ahmad

Reputation: 72673

Set this instead

android:textStyle="italic"

Upvotes: 3

Related Questions