Jas
Jas

Reputation: 3212

Setting Button text through XML

I want to add a String Rate ₹ as my Button text I tried using

<string name="Rs">\u20B9</string>

which is working fine. But I am confused about adding the text Rate .

       <Button
            android:id="@+id/btnRate"
            android:layout_width="wrap_content"
            android:layout_margin="5dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="@string/Rs"
            android:background="@android:color/transparent"/>

Any help will be greatly appreciated

Upvotes: 1

Views: 56

Answers (2)

Alok Gupta
Alok Gupta

Reputation: 1360

Please try

<string name="Rs">Rate \u20B9</string>

Upvotes: 1

Febi M Felix
Febi M Felix

Reputation: 2839

<string name="Rs">Rate \u20B9</string> This should work.

Upvotes: 2

Related Questions