I write this line in the strings.xml:
<string name="Help">This<b>Caaaaaa</b> on the spot.</string>
But the characters between the <b>
tag don't become bold. What am I doing incorrectly?
PS:I just wanna make some part in the string (like "Caaaaa" above) bold.
When you set the text of some widget to this string use the following code:
In strings.xml use this to add ur string:
<string name="Help">
<![CDATA[
This <b>Caaaaaa</b> on the spot.
]]>
</string>
In your activity
yourWidget.setText(Html.fromHtml(getString(R.string.Help)));
I think you can't do that in string.xml file.
but you can set textStyle="bold" where you are using it.
like-
<TextView android:textSize="18dip"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="@color/white"
android:textStyle="bold"
android:text="@string/Help"
android:id="@+id/header">
</TextView>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With