Android-如何在TextView上显示带边框的文本?

Android-如何在TextView上显示带边框的文本?,android,user-interface,custom-controls,border,Android,User Interface,Custom Controls,Border,有没有办法在文本视图上显示带边框的文本?我建议扩展 看 然后在布局xml中使用它: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layo

有没有办法在文本视图上显示带边框的文本?

我建议扩展

然后在布局xml中使用它:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <samples.test.MyTextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="@string/hello" />
</LinearLayout>

最简单的方法是使用9补丁背景

<TextView android:id="@+id/txt_target"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="000000000"
            android:gravity="center_vertical"
            android:background="@drawable/textfield_default"
            android:layout_marginRight="5dip" />


能否澄清“带边框文本”的含义?谢谢回复。我的意思是文本中的每个字母都有边框。怎么做?对不起,我的英语不好。
<TextView android:id="@+id/txt_target"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="000000000"
            android:gravity="center_vertical"
            android:background="@drawable/textfield_default"
            android:layout_marginRight="5dip" />