简体   繁体   中英

Unicode for registered trademark not displaying properly in Android string?

I want to display the symbol ® in my string, for which i have added a unicode in the string file. but it does not look like what i have expected the symbol should be small and to the power to application string. i have tried the same in a POC in a hello world string and there it is working fine, it is difficult to investigate the while the line of code is same for both the application.

this is what i have written in strings:

<string name="helloworld">Hello World <sup><small>&#174;</small></sup></string>

Hello World ® this is what i got as result where the expected one in different.

PS EXPECTED RESULT IS GIVE BELOW :

在此处输入图片说明

Make your textview like this:

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/helloworld"
        android:textStyle="bold"
        android:textSize="25sp"/>

And your string like below:

<string name="helloworld">Hello World <sup><b>&#xae;</b></sup></string>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM