如何在Android TextView中实现此目的?

时间:2015-10-16 20:52:39

标签: android android-layout fonts textview

我在android textview中显示了一些数字,我想看看下面显示的数字。 有没有办法为textview中的每个角色添加背景图像,还是有其他方法来实现这一目标?

我在google上搜索了答案,但没有运气。任何帮助将不胜感激。

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="1234567890"
    android:textSize="50sp"
    android:id="@+id/tvTotal"
    android:layout_alignTop="@+id/textView6"
    android:layout_toRightOf="@+id/textView6"
    android:layout_toEndOf="@+id/textView6" />

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:2)

下载这样的字体并告诉textview使用它。 http://www.dreamstime.com/royalty-free-stock-images-flip-board-letters-numbers-image21493569

Typeface type = Typeface.createFromAsset(getAssets(),"fonts/my_font.ttf"); 
tvTotal.setTypeface(type);
相关问题