Add tick mark (✔) to string.xml

前端 未结 4 1891
一向
一向 2021-02-18 14:57

I am adding tick mark (✔) on a string message on the strings.xml, but I am getting a \"box\" instead of the tick mark when I am display that on the mobile device.<

相关标签:
4条回答
  • 2021-02-18 15:09

    Check this android's group thread: Supported unicode characters.

    Instead of using an unicode value, I would also recommend you to use a Drawable inside a TextView. For example, you can add the drawable to the TextView using android:drawableRight.

    0 讨论(0)
  • 2021-02-18 15:14

    You could use Html.fromHtml to get a Spannable text and set it to your text view. In string.xml you will specify the corresponding HTML entity such as &gt;

    0 讨论(0)
  • 2021-02-18 15:19

    Add unicode symbol "\u2713" to your string resource or you can use it from code as String object.

    String checkedMark = "\u2713";
    
    0 讨论(0)
  • 2021-02-18 15:25

    Try using &#x2713; as the string value, then use Html.fromHtml to parse the string.

    0 讨论(0)
提交回复
热议问题