2
可以生成與下面的代碼圓形梯度:橢圓漸變的Android
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:centerColor="#c1c1c1"
android:endColor="#4f4f4f"
android:gradientRadius="400"
android:startColor="#c1c1c1"
android:type="radial" >
</gradient>
</shape>
但一會怎麼畫橢圓漸變在android系統?即X和Y的不同半徑?
謝謝你的答案,但正如你可能知道,由於級別問題,可繪製比例不可見。出於某種原因,將其可繪製級別設置爲1以使其可見並不適用於Android ICS。你有任何解決方法嗎? –
@EnesBattal - 我不明白你的意見。繪圖級別必須與['LevelListDrawable'](http://developer.android.com/guide/topics/resources/drawable-resource.html#LevelList),而不是'ScaleDrawable'。如果您指的是API級別,自API級別1以來已經支持'ScaleDrawable'。 –
但是,ScaleDrawable afaik存在一個問題,如果它沒有未顯示的級別,請參閱http:// stackoverflow。 com/questions/5507539/android-scaledrawable-doesnt-seems-to-work –