我如何用中风创建聊天泡沫

发布于 2025-02-05 04:12:13 字数 322 浏览 2 评论 0原文

我正在构建聊天应用程序,需要在图像中创建这样的聊天气泡。我需要显示/隐藏泡沫周围的浅绿色中风。我能够在的帮助下实现聊天气泡形状。如何在聊天泡沫周围添加这种中风?

I'm building a chat app and I need to create chat bubbles like this in the image. I need to show/hide the light green stroke around the bubble. I'm able to achieve the chat bubble shape drawable with the help of this post. How can I add such stroke around the chat bubble?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

感悟人生的甜 2025-02-12 04:12:14

您可以使用< stroke/>,该>应放置在< shape>>/shape>标签内。只有当您制作两个相同的可抽签,一个带有中风,一个没有,或使用颜色状态列表(通过< selector/>),才能直接显示和隐藏绿色中风冲程颜色(两个不同状态的透明和绿色)可以在您的代码中更改。 (例如android:state_selected,可用于appcompatimagebutton作为在您的代码中Isselected

You can use <stroke/> which should be placed inside the <shape></shape> tag inside your drawable. There is no way to directly show and hide the green stroke, only if you make two identical drawables, one with stroke and one without, or use color state list (through <selector/>) for stroke color (transparent and green for two different states) which can later be changed in your code. (For example android:state_selected, it's available for AppCompatImageButton as isSelected in your code)

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