我有一个带有单个字符的textView(所有单个数字,数字0-9).我想在数字周围画一个圆圈或一个正方形.我看到一个线程提到使用九个补丁来围绕它,但我不确定如何做到这一点(或者如果它是最好的方法).我怎么能围绕数字圈?
谢谢
ant*_*afe 56
只需要像这样创建一个圆形的drawable
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="10dip"/>
<stroke android:color="@color/red" android:width="2dip"/>
<solid android:color="@android:color/transparent"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
并将此drawable设置为TextView背景.