Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提个建议关于阴影的 柔和 #3

Closed
HMZhhh opened this issue Sep 12, 2019 · 2 comments
Closed

提个建议关于阴影的 柔和 #3

HMZhhh opened this issue Sep 12, 2019 · 2 comments

Comments

@HMZhhh
Copy link

HMZhhh commented Sep 12, 2019

首先很感谢开源,很少见到带阴影的能改变颜色的方案,
当初被产品带颜色的阴影给整崩溃了,后来才同意不考虑颜色,现在看到这个库,以后可以站直说话了。。
------------以上为废话
重点就是 阴影的过度很生硬 相对来说 就是丑,我觉得可以添加 透明度 来使阴影 柔和下来,就会更好了,alpha,一点建议。

@HMZhhh
Copy link
Author

HMZhhh commented Sep 12, 2019

我直接 在draw 的paint 增加属性 alpha(122),阴影是柔和了 但是 会影响本身的视图,刚看没多久代码,我是有一点疑问,为什么您要设置在布局内作管理 而不是单纯给单一控件添加即可。。。

@Mosect
Copy link
Owner

Mosect commented Sep 12, 2019

你好,将ShadowColor设置成带有透明度颜色即可,比如:#80000000;使用内存的原因是因为内部使用了bitmap暂存阴影效果,如果每个视图都独自使用,则可能会非常消耗内存。大部分项目,阴影都是一样的,因此做缓存进行复用非常值得。其实可以不用bitmap先缓存阴影效果,可以直接缓存,但那样就会出现很大的性能消耗。并且view必须关闭硬件加速才行。综合以上,采用了bitmap缓存加上bitmap公用(其实是.9图) @HMZhhh

@Mosect Mosect closed this as completed Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants