在strings.xml中更改字体类型

时间:2012-11-14 14:36:50

标签: java android xml fonts

好的,所以我熟悉如何更改android开发的字体类型等。但是,我无法通过这个例子找到一种方法。

string.xml的代码 ...

<string-array name="help_labels">
    <item> item 1</item>
    <item> item 2</item>
    <item> item 3</item>
    <item> item 4</item>
</string-array>
<string-array name="help_txt">
    <item> item 1 description: blah blah blah blah</item>
    <item> item 2 description: blah blah blah blah</item>
    <item> blah blah blah blah</item>
    <item> blah blah blah blah</item>
</string-array>

xml布局......

<TextView
    android:text="TextView"
    android:id="@+id/helpDetailText"
    android:cacheColorHint="#00000000"
    android:background="@layout/rectangle_border"
    android:textColor="@color/black1"
    android:padding="10dp"
    android:textSize="17.0sp"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
</TextView>

Java代码..

public static final String HELP_TEXT = "helpText";
item = getIntent().getExtras().getSerializable(HELP_TEXT);
    TextView helpDetailText = (TextView) findViewById(R.id.helpDetailText);
    if (item != null) {
        if (isHtmlHelpText) {
            helpDetailText.setText(Html.fromHtml(item.toString()).toString());
        } else {
            helpDetailText.setText(item.toString());
        }
    }

我正在尝试做什么......

所以基本上标签会导致每个项目的详细页面。我似乎无法找到一种方法来改变描述中的字体类型..我想在每个段落之前用粗体标题组织段落。这看起来很简单(也可能是这样),但我无法弄明白。我尝试了html代码(<b> label </b>),但这也没有用。

0 个答案:

没有答案
相关问题