我如何用中风创建聊天泡沫
我正在构建聊天应用程序,需要在图像中创建这样的聊天气泡。我需要显示/隐藏泡沫周围的浅绿色中风。我能够在的帮助下实现聊天气泡形状。如何在聊天泡沫周围添加这种中风?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
< 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 exampleandroid:state_selected
, it's available forAppCompatImageButton
asisSelected
in your code)