我试图以编程方式重现以下渐变.
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/startcolor"
android:centerColor="#343434"
android:endColor="#00000000"
android:type="radial"
android:gradientRadius="140"
android:centerY="45%"
/>
<corners android:radius="0dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)
如何以编程方式设置参数?谢谢
android:centerY="45%"
Run Code Online (Sandbox Code Playgroud)