Gradient Radius as percentage of screen size

前端 未结 5 1847
南方客
南方客 2020-12-08 13:56

I\'m trying to create a shape drawable with radial gradient background, with radius that will adjust to the screen size (take a look at the relevant documentation).

5条回答
  •  情书的邮戳
    2020-12-08 14:15

    You could create a shape drawable at runtime similiar to this post https://stackoverflow.com/a/4943888/604504

    This way you could calculate the percentage after retrieving the screen size.

提交回复
热议问题