形状玻璃效果
我使用形状内的渐变创建了一个自定义工具栏。它看起来非常漂亮,但由于我们只有 3 种颜色(startColor、centerColor、endColor)的选项,所以它看起来很圆。我想做一个玻璃效果,需要中间颜色发生急剧变化。基本上我需要 4 种颜色(startColor、justabovecenterColor、justbelowcenterColor、endColor)。现在我可以将两个形状放在一起以获得这种效果,但我不想这样做。我在这里进行一些棘手的 UI 自定义,这在不同尺寸的屏幕上管理起来非常困难。
有谁知道如何创建玻璃效果?
I've created a custom toolbar using a gradient inside a shape. It looks very nice, but since we only have the option for 3 colors (startColor, centerColor, endColor) it looks very round. I would like to do a glass effect, which requires a sharp change in color in the middle. Basically I need 4 colors (startColor, justabovecenterColor, justbelowcenterColor, endColor). Now I could have two shapes sitting on top of each other to get this effect, but I don't want to do this. I'm getting into some tricky UI customization here and that would be very difficult to manage on different sized screens.
Does anyone know how I can create a glass effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过使用 NinePatch ?这将是一种快速、简单的方法来制作一组美观、可扩展的形状......
Have you considered using a NinePatch ? This would be a quick and easy way to make a good looking, scalable set of shapes...