Android unicode字符字体颜色

时间:2015-10-14 08:21:41

标签: android unicode

我有一个应用程序,我使用Unicode字符来显示箭头。箭头都需要特定的颜色。

这是Android Studio设计器的结果:

enter image description here

这是我手机上的结果:

enter image description here

它在设计师中工作得很好,而不是在我的手机上。如何在手机上的箭头处获得紫色?

我的代码:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView74"
        android:layout_gravity="center_horizontal"
        android:text="Meer informatie..."
        android:textColor="#5e5e5e" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="\u25B6"
        android:id="@+id/textView75"
        android:textColor="#6B00E4" />
</LinearLayout>

修改

我在其他人的智能手机和模拟器上测试过,它似乎适用于模拟器和其他手机。模拟器和手机都有最新的Android版本之一,它不能工作的手机只有4.2.2。这可能是与Android版本的版本有关吗?

1 个答案:

答案 0 :(得分:0)

尝试textView75.setText(Html.fromHtml("\u25B6"));