android中一些特殊字符(如:←↑→↓等箭头符号)的Unicode码值

 在项目中,有时候在一些控件(如Button、TextView)中要添加一些符号,如下图所示:

android中一些特殊字符(如:←↑→↓等箭头符号)的Unicode码值                        android中一些特殊字符(如:←↑→↓等箭头符号)的Unicode码值

这个时候可以使用图片的方式来显示,不过这些可以直接使用Unicode码就直接显示出来了。

4个箭头图标的代码如下:

[html] view plain copy
 
  1. <RelativeLayout  
  2.             android:layout_width="0dp"  
  3.             android:layout_height="match_parent"  
  4.             android:layout_weight="1"  
  5.             android:gravity="center_horizontal" >  
  6.   
  7.             <Button  
  8.                 android:id="@+id/scroll_left"  
  9.                 android:layout_width="40dip"  
  10.                 android:layout_height="40dip"  
  11.                 android:layout_alignParentLeft="true"  
  12.                 android:layout_centerVertical="true"  
  13.                 android:text="@string/left_arrow" />  
  14.   
  15.             <Button  
  16.                 android:id="@+id/scroll_up"  
  17.                 android:layout_width="40dip"  
  18.                 android:layout_height="40dip"  
  19.                 android:layout_alignParentTop="true"  
  20.                 android:layout_toRightOf="@id/scroll_left"  
  21.                 android:text="@string/up_arrow" />  
  22.   
  23.             <Button  
  24.                 android:id="@+id/scroll_down"  
  25.                 android:layout_width="40dip"  
  26.                 android:layout_height="40dip"  
  27.                 android:layout_below="@id/scroll_up"  
  28.                 android:layout_toRightOf="@id/scroll_left"  
  29.                 android:text="@string/down_arrow" />  
  30.   
  31.             <Button  
  32.                 android:id="@+id/scroll_right"  
  33.                 android:layout_width="40dip"  
  34.                 android:layout_height="40dip"  
  35.                 android:layout_centerVertical="true"  
  36.                 android:layout_toRightOf="@id/scroll_down"  
  37.                 android:text="@string/right_arrow" />  
  38.         </RelativeLayout>  



皇冠和音乐图标代码如下:

[html] view plain copy
 
  1. <LinearLayout  
  2.      android:layout_width="wrap_content"  
  3.      android:layout_height="wrap_content"  
  4.      android:orientation="vertical" >  
  5.   
  6.      <Button  
  7.          android:layout_width="wrap_content"  
  8.          android:layout_height="wrap_content"  
  9.          android:text="@string/music" />  
  10.   
  11.      <Button  
  12.          android:layout_width="wrap_content"  
  13.          android:layout_height="wrap_content"  
  14.          android:text="@string/crown" />  
  15.  </LinearLayout>  

上面的几个字符串值为:

[html] view plain copy
 
  1. <string name="music">u265A</string>  
  2. <string name="crown">u266B</string>  
  3.   
  4. <string name="left_arrow">u2190</string>  
  5. <string name="up_arrow">u2191</string>  
  6. <string name="down_arrow">u2193</string>  
  7. <string name="right_arrow">u2192</string>  


 ====================================================================================================

从网上找到了部分关于特殊符号的Unicode码值,记录下来,以备后用,如下所示:  
用Android的string.xml中使用Unicode表示符号的话,就使用下面的JS相关的Unicode值即可

⇠  箭头类

符号 UNICODE 符号 UNICODE
HTML JS CSS HTML JS CSS
&#8672 u21E0 21E0 &#8674 u21E2 21E2
&#8673 u21E1 21E1 &#8675 u21E3 21E3
&#8606 u219E 219E &#8608 u21A0 21A0
&#8607 u219F 219F &#8609 u21A1 21A1
&#8592 u2190 2190 &#8594 u2192 2192
&#8593 u2191 2191 &#8595 u2193 2193
&#8596 u2194 2194 &#8597 u2195 2195
&#8644 u21C4 21C4 &#8645 u21C5 21C5
&#8610 u21A2 21A2 &#8611 u21A3 21A3
&#8670 u21DE 21DE &#8671 u21DF 21DF
&#8619 u21AB 21AB &#8620 u21AC 21AC
&#8668 u21DC 21DC &#8669 u21DD 21DD
&#8602 u219A 219A &#8603 u219B 219B
&#8622 u21AE 21AE &#8621 u21AD 21AD
&#8678 u21E6 21E6 &#8680 u21E8 21E8
&#8679 u21E7 21E7 &#8681 u21E9 21E9
&#9650 u25B2 25B2 &#9658 u25BA 25BA
&#9660 u25BC 25BC &#9668 u25C4 25C4
&#10132 u2794 2794 &#10137 u2799 2799
&#10152 u27A8 27A8 &#10162 u27B2 27B2
&#10140 u279C 279C &#10142 u279E 279E
&#10143 u279F 279F &#10144 u27A0 27A0
&#10148 u27A4 27A4 &#10149 u27A5 27A5
&#10150 u27A6 27A6 &#10151 u27A7 27A7
&#10165 u27B5 27B5 &#10168 u27B8 27B8
&#10172 u27BC 27BC &#10173 u27BD 27BD
&#10170 u27BA 27BA &#10163 u27B3 27B3
&#8631 u21B7 21B7 &#8630 u21B6 21B6
&#8635 u21BB 21BB &#8634 u21BA 21BA
&#8629 u21B5 21B5 &#8623 u21AF 21AF
&#10174 u27BE 27BE        

❤  基本形状类

符号 UNICODE 符号 UNICODE
HTML JS CSS HTML JS CSS
&#10084 u2764 2764 &#9992 u2708 2708
&#9733 u2605 2605 &#10022 u2726 2726
&#9728 u2600 2600 &#9670 u25C6 25C6
&#9672 u25C8 25C8 &#9635 u25A3 25A3
&#9787 u263B 263B &#9786 u263A 263A
&#9785 u2639 2639 &#9993 u2709 2709
&#9742 u260E 260E &#9743 u260F 260F
&#9990 u2706 2706 &#65533 uFFFD FFFD
&#9729 u2601 2601 &#9730 u2602 2602
&#10052 u2744 2744 &#9731 u2603 2603
&#10056 u2748 2748 &#10047 u273F 273F
&#10048 u2740 2740 &#10049 u2741 2741
&#9752 u2618 2618 &#10086 u2766 2766
&#9749 u9749 9749 &#10050 u2742 2742
&#9765 u2625 2625 &#9774 u262E 262E
&#9775 u262F 262F &#9770 u262A 262A
&#9764 u2624 2624 &#9988 u2704 2704
&#9986 u2702 2702 &#9784 u2638 2638
&#9875 u2693 2693 &#9763 u2623 2623
&#9888 u26A0 26A0 &#9889 u26A1 26A1
&#9762 u2622 2622 &#9851 u267B 267B
&#9855 u267F 267F &#9760 u2620 2620

¥  货币类

符号 UNICODE 符号 UNICODE
HTML JS CSS HTML JS CSS
$ &#36 u0024