如果我们在做圆形提示的时候 看下效果

我们在TextVIew里面设置background的值:
先定义圆形文件:filled_circle.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<solid android:color="@color/orange" />
</shape>
然后再添加进去TextView
<TextView
android:id="@+id/text"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/filled_circle"
android:gravity="center"
android:padding="0dp"
android:textColor="@color/C_white"
android:textSize="12dp"
android:visibility="invisible" />
ok 效果出来,简单方便快捷
本文介绍了一种使用Android自定义形状的方式创建圆形提示的方法。通过定义一个名为filled_circle.xml的文件来实现圆形背景,并将其应用于TextView中,使得文本视图具备圆形外观。此方法简单便捷,适用于需要圆形提示的应用场景。
4万+

被折叠的 条评论
为什么被折叠?



