You need to enable JavaScript to run this app. 如何修改布局文件中drawable shape的背景色以实现多色圆形布局?
优惠活动
大模型
产品
解决方案
定价
更多

如何修改布局文件中drawable shape的背景色以实现多色圆形布局?

这是我编写的圆形drawable shape,对应的XML定义如下:

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <size
        android:width="30dp"
        android:height="30dp"/>
    <gradient
        android:angle="0"
        android:startColor="#FF63a34a"
        android:endColor="#FF477b36"
        android:type="linear"/>
</shape>

我希望使用不同配色的上述圆形drawable shape,实现截图所示的布局效果(布局示意图参考)。


内容的提问来源于stack exchange,提问作者mj sunny

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.31 23:45:00