gpt4 book ai didi

android - 添加渐变变化到中心和背面

转载 作者:行者123 更新时间:2023-11-29 16:19:07 24 4
gpt4 key购买 nike

我需要把这个像项目的背景放在列表中,它工作正常。如果我想开始和结束颜色相同但更改为 first_color(start)->second_color(center)->first_color(end) 应该更改什么?

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#aa0099"
android:endColor="#aa0099"
android:angle="270"
/>
<corners android:radius="1dp"/>
</shape>

最佳答案

试试这个作为中心

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#aa0099"
android:centerColor="#9900aa"
android:endColor="#aa0099"
android:angle="270"
/>
<corners android:radius="1dp"/>
</shape>

因为您可以设置 centerColor 的颜色并检查角度值

关于android - 添加渐变变化到中心和背面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8165197/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com