简体   繁体   中英

How to make an infinity sign on Android?

I know there's this question , but '\∞' doesn't work for me. Also this is Android-specific. Surely there must be a way to show an infinity sign!

Never mind, found it myself:

DecimalFormatSymbols.getInstance().getInfinity()

Note that it may not work with some custom fonts.

You can create a new item in "strings.xml":

<string name="infinity">&#8734;</string>

And then call it using your Context:

textView.setText(context.getString(R.string.infinity));

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