背景阴影
Android中是否有任何方法可以应用落下阴影,如FIGMA或XD工具所示?
? >
我有一个figma设计,我被困在创建此滴效果上,我有使用选择器
和layer-list
尝试了它,
是否有任何方法可以应用 x,y和blur 以及带有不透明度的阴影颜色。
上面的属性仅适用于 deDittext ,但在下面不适合 textInputlayout
我的视图属性在下面。
Is there any way in Android that applies drop shadow as shown in Figma or XD Tool ?
I have got a figma design and I am stuck in creating this drop effect I have tried it using selector
and layer-list
Is there any way to apply x , y and blur effect along with shadow color with opacity.
The above attributes only work for EditText but not working for TextInputLayout
My View Attribues in Figma are below .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
新的和最佳的方法(我希望那是您需要的)
您只需在 drawsable 中创建一个text_input_selector
text_input_selector.xml
现在创建一个在 drawsable < /strong>
现在为背景发光创建 绘制 background_glow.xml
New and Best Approach (I hope that's what you required)
you just create a text_input_selector in drawable
text_input_selector.xml
Now create a shape for background glow in drawable
background_glow.xml
要设置文本小部件文本下面的文本的模糊阴影,您可以使用 Shadowcolor,Shadowdx,Shadowdy和Shadowradius TextView的属性。
shadowcolor 指定阴影的颜色。您可以在 rgb , argb , rrggbb 或 aarrggbb 格式中指定颜色。
shadowdx 指定阴影的水平偏移。它需要一个浮点值。
Shadowdy 指定阴影的垂直偏移。它需要一个浮点值。
Shadowradius 指定阴影的模糊半径。它需要一个浮点值。
或
To set a blurred shadow of text underneath the text in TextView widget, you can use shadowColor, shadowDx, shadowDy and shadowRadius attributes of TextView.
shadowColor specifies the color of shadow. You can specify color in rgb, argb, rrggbb, or aarrggbb formats.
shadowDx specifies the horizontal offset of the shadow. It takes a float value.
shadowDy specifies the vertical offset of the shadow. It takes a float value.
shadowRadius specifies the blur radius of the shadow. It takes a float value.
or
round_corner.xml
utlinespotshadowcolor
和oflineambientshadowcolor
您将设置设置阴影颜色,然后您需要设置translationz
vlaue使阴影显示round_corner.xml
outlineSpotShadowColor
andoutlineAmbientShadowColor
you going to set the shadow color, then you need to settranslationZ
a vlaue to make the shadow showen使用层列表的良好工作方法,只需根据需要更改纯色即可。
A good working approach to use Layer-list , Just Change solid color as required .