How do I insert special characters as text in XML editor for Android?

前端 未结 7 827
南笙
南笙 2021-02-06 03:50

So, I\'m writing an app that involves using some mathematical symbols. I\'m doing this in the visual XML editor. Is there any way I can get, say, an integral symbol, or a \"less

7条回答
  •  青春惊慌失措
    2021-02-06 04:31

    Try put they as HTML.

    String htmlStringWithMathSymbols = "≤  ≥";
    
    textView.setText(Html.fromHtml(htmlStringWithMathSymbols));
    

    Here you can display your math symbol in textView

    Here the post http://www.hrupin.com/2011/12/how-to-put-some-special-math-symbols-in-textview-editview-or-other-android-ui-element

    Hope, it help you!

提交回复
热议问题