TextView 中的度数符号(如摄氏度/华氏度) [英] Degrees symbol (as in Degrees Celsius/Fahrenheit) in a TextView

查看:18
本文介绍了TextView 中的度数符号(如摄氏度/华氏度)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将小圆形度数符号包含到 TextView 中?这将用于温度读数,如摄氏度或华氏度.我想知道是否有人以前以编程方式完成过此操作.

Is there a way to include the small circular degrees symbol to a TextView? This would be for temperature readings, as in degrees Celsius or Fahrenheit. I'm wondering if anyone has done this programmatically before.

推荐答案

你可以在 Java 中使用一个 Unicode 符号来表示摄氏温度:u2103.对于华氏温度,您可以使用 u2109.

There is a Unicode symbol for Celsius degrees that you can use in Java: u2103. For Fahrenheit you can use u2109.

我已确认这适用于运行 Android 版本 2.3.6 的 Android Nexus S.

I have confirmed this works on Android Nexus S running Android version 2.3.6.

示例代码:

temperatureValue.setText((result) + " u2109");

这篇关于TextView 中的度数符号(如摄氏度/华氏度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆