Android背景噪音效果
我见过的很多新的 Android 应用程序都使用噪声效果< /a> 在他们的背景上,通常是渐变的。有趣的是,一些应用程序在整个应用程序中使用半径渐变来实现这种效果,这将需要大量的磁盘空间来存储图像。现在Android有了GradientDrawable,可以非常轻松地创建渐变。我正在考虑以编程方式创建噪音效果。
以前有其他人这样做过吗?如果是的话,你是怎么做的?您只是使用图像还是编写自己的自定义噪声叠加层?
A lot of new Android applications I've been seeing are using a noise effect on their backgrounds, usually a gradient. What interesting is that some applications use radiel gradients throughout their application with this effect, which would require a lot of disk space for the images. Now Android has GradientDrawable which can create gradients very easily. I was thinking about creating the noise effect programmatically.
Has anyone else done this before and if so, how did you go about it? Did you just use an image or write your own custom noise overlay?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想以编程方式消除色带,您可以通过覆盖 Activity 的
onAttachedToWindow()
回调来实现,如下所示:这对于我的正常应用程序非常有效。我还没有用小部件对此进行测试。
If you just want to eleminate the Color Banding programmaticaly you can do so by overiding the
onAttachedToWindow()
callback of your activity like this:This worked very well for my normal applications. I didn't test this with widdgets yet.