漸變的實現有很多種xml實現是其中的一種。
漸變屬性大概介紹
- <!--android:startColor="#aa000000" 漸變起始色值
- android:centerColor="" 漸變中間色值
- android:endColor="#ffffffff" 漸變結束顏色
- android:angle="45" 漸變的方向 默認爲0 從做向右 ,90時從下向上 必須爲45的整數倍
- android:type="radial" 漸變類型 有三種 線性linear 放射漸變radial 掃描線性漸變sweep
- android:centerX="0.5" 漸變中心相對X座標只有漸變類型爲放射漸變時有效
- android:centerY="0.5" 漸變中心相對Y座標只有漸變類型爲放射漸變時有效
- android:gradientRadius="100" 漸變半徑 非線性放射有效
- -->
- <gradient
- android:startColor="#000000"
- android:endColor="#ffffff"
- android:type="sweep"
- android:centerX="0.5"
- android:centerY="0.5"
- android:gradientRadius="100"/></span>