Circular gradient in android

后端 未结 7 888
灰色年华
灰色年华 2020-12-04 06:30

I\'m trying to make a gradient that emits from the middle of the screen in white, and turns to black as it moves toward the edges of the screen.

As I make a \"normal

相关标签:
7条回答
  • 2020-12-04 07:21

    I guess you should add android:centerColor

    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
      android:startColor="#FFFFFF"
      android:centerColor="#000000"
      android:endColor="#FFFFFF"
      android:angle="0" />
    </shape>
    

    This example displays a horizontal gradient from white to black to white.

    0 讨论(0)
提交回复
热议问题