0

Androidのドキュメントに示されている方法を使用してテキストを太字にしようとしていますが、何らかの理由でテキストがまだ太字に表示されません。

http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling

XML:

<string name="updated_text">This is sample text. If this doesn\’t work, go to<b> news.google.com</b>; to find more infomation.</string> 

ジャワ:

TextView assistInstrText = (TextView) findViewById(R.id.updated_text);
            assistInstrText.setText(Html.fromHtml(getResources().getString(R.string.updated_text)));
            assistInstrText.setText(styledText);
4

1 に答える 1

0

テキストビューでテキストを設定していますか? テキストを設定するときにHtml.fromHtml(String)を使用する必要がある場合があるためです

ここで答えを見てください

于 2013-10-22T19:13:47.077 に答える