TextView - Leave only one word in bold

0

I have TextView which shows the following text on the screen:

Like this:

value:
PROMOTION!

How do I:

value:
PROMOTION!

Do you have put bold in just one word of TextView ? That is, I have to do this without having to create 2% with bold , one without bold .

I would like to use only one.

Code:

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Valor:\nPROMOÇÃO!"
        android:id="@+id/textView"
        android:layout_gravity="left|top"
        android:layout_marginTop="70dp"
        android:layout_marginLeft="15dp"
        android:textSize="15dp"
        android:textAlignment="center"
        android:gravity="center_horizontal"
        android:textColor="#42a56b" />
    
asked by anonymous 08.02.2017 / 20:59

2 answers

3
android:text="@string/promotion"

<string name="promotion">valor:<br /><b>PROMOÇÃO!</b></string>

    
08.02.2017 / 21:53
0

Dude, I do not think there's any way to change the style of just one word within the text view. When you set the property it will put all the component text in this format.

Could not you just use two or three TextViews? That is, you would separate the part of the text you want to put as bold in a separate TextView, with this property set.

    
08.02.2017 / 21:26