形状玻璃效果

发布于 2024-09-14 14:44:33 字数 285 浏览 2 评论 0原文

我使用形状内的渐变创建了一个自定义工具栏。它看起来非常漂亮,但由于我们只有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心欲静而疯不止 2024-09-21 14:44:33

您是否考虑过使用 NinePatch ?这将是一种快速、简单的方法来制作一组美观、可扩展的形状......

Have you considered using a NinePatch ? This would be a quick and easy way to make a good looking, scalable set of shapes...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文