简体   繁体   中英

Android: Special charaters in button names

How do I have special characters such as greek/latin letters, longer dashes etc in my button text name? In the sample below, I want to replace 1234 in android:text="1234" with special characters.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="1234" />

</LinearLayout>

You can use Unicode character hexa position just prefix it with \\u\u003c/code> inside String

"Ά" = (char)0x0386 = "\Ά"

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