Below is the XML I am using and when I use the android:textStyle="italic" attribute, the text doesn't show up. Basically any TextView with the style SummarySubtitle will not show up.
<style name="SummarySubtitle" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_weight">1</item>
<item name="android:paddingRight">6dp</item>
<item name="android:textSize">12dp</item>
<item name="android:textStyle">italic</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="70dp"
android:orientation="vertical">
<LinearLayout android:id="@+id/summary_header"
android:layout_width="fill_parent" android:layout_height="30dp"
android:orientation="horizontal">
<TextView android:id="@+id/summary_title" android:text="Title"
style="@style/SummaryTitle"/>
<TextView android:id="@+id/summary_subtitle"
android:text="Subtitle " style="@style/SummarySubtitle"/>
</LinearLayout>
<LinearLayout android:id="@+id/summary_subheader"
android:layout_width="fill_parent" android:layout_height="20dp"
android:orientation="horizontal">
<TextView android:id="@+id/summary_min" android:text="@string/min"
style="@style/SummaryHeader"/>
<TextView android:id="@+id/summary_max" android:text="@string/max"
style="@style/SummaryHeader"/>
<TextView android:id="@+id/summary_avg" android:text="@string/avg"
style="@style/SummaryHeader"/>
</LinearLayout>
<LinearLayout android:id="@+id/summary_values"
android:layout_width="fill_parent" android:layout_height="20dp"
android:orientation="horizontal">
<TextView android:id="@+id/summary_value_min"
android:text="$0.00" style="@style/SummaryValue"/>
<TextView android:id="@+id/summa开发者_运维问答ry_value_max"
android:text="$0.00" style="@style/SummaryValue"/>
<TextView android:id="@+id/summary_value_avg"
android:text="$0.00" style="@style/SummaryValue"/>
</LinearLayout>
</LinearLayout>
All I found on the subject so far
http://groups.google.com/group/android-developers/browse_thread/thread/843376e298e95e14
Relevant quote: "Oh yeah, I have seen that too. But when you run your app, it renders correctly."
It doesn't show up on the layout's graphical representation but works correctly when you build and run the app.
try using this code:
adInfoTV.setTypeface(Typeface.MONOSPACE,Typeface.ITALIC);
精彩评论