简体   繁体   中英

How to draw a customized shadow under the line on canvas in Android

I have a android app, and I try to draw some shadow under the line on canvas. How can I manage to do that.

I've draw some line with MPAndroidChart , and setShadowLayer to renderPaint, so what I got is: 在此输入图像描述 All point in shadow share the same offset to the red line.

But what I want is : 在此输入图像描述 All shadow point lies under the gradient color line.

How can I achieve that, any prompt or work around? Thanks.

After some research, I figure out that android did not support drawing shadow that like the second picture.

And, my bad, I can simply draw another blank line to be the shadow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM