I want to know how to make a degree symbol for an angle in a Text View (android). There are a few questions similar to this, I have tried them but they don't seem to work.
<TextView
android:id="@+id/tv_counter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="20dp"
android:text="..."
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="80dp"
android:textColor="#FFA500" />
Press and hold the ALT key and type 0 1 7 6 on the numeric keypad of your keyboard. Make sure the NumLock is on and type 0176 with the leading zero. If there is no numeric keypad, press and hold the Fn before typing the 0176 numbers of degree symbol.
temp = temp. replaceAll(" ", "%20");
XML doesn't use C-style escapes, it uses HTML-style character entities. Try this:
android:text="50℃"
As you mention in the comment, U+2103 isn't what you want, you want this:
android:text="50°"
Try this:
android:text= "50℃"
See also Unicode in XML and other Markup Languages.
In Code:
myTextView.setText ( "78" + (char) 0x00B0 );
"OR"
In XML:
android:text="50℃"
in xml - if you want just the symbol without F or C just use:
"\u00B0"
like this:
android:text="50\u00B0"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With