[英]Android edge to edge gradient
我正在嘗試在矩形內獲取漸變以使其看起來像這樣
我使用以下xml得到的最接近的是
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="radial"
android:startColor="@color/lightPurple"
android:endColor="@color/lightGreen"
android:gradientRadius="600"
android:angle="270"
android:centerX="1"
android:centerY="0"/>
</shape>
我可以做些什么使漸變從右上角到左下角?
嘗試android:type='linear'
和android:angle='45'
。
to . 這將使您更 。 Android 對此不提供任意角度 。 唯一有效的角度是45
的倍數。 但是,據我所知,您所需的漸變實際上並不是邊緣到邊緣的,我懷疑它是角度為45
的漸變。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.