我正在尝试使用带有光环的 xml 制作一个圆圈。光环就像从中心的绿色开始,绿色不断褪色,最后在边缘变得透明。
该怎么办呢?
我正在尝试使用以下内容:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient android:centerColor="@drawable/light_green" android:gradientRadius="250" android:type="radial"
android:endColor="@android:color/transparent"
android:angle="270"/>
</shape>
还是没能达到想要的效果。任何线索都会有帮助。
尝试这个:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:angle="270"
android:centerColor="#88FF0000"
android:centerX="50%p"
android:centerY="50%p"
android:endColor="#00FF0000"
android:gradientRadius="50%p"
android:startColor="#FFFF0000"
android:type="radial" />
<size
android:height="80dp"
android:width="80dp" />
</shape>
根据您的要求更改颜色代码并更改 centerColor 的 alpha 代码
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)