为ImageView添加阴影 [英] Add a shadow to an ImageView
本文介绍了为ImageView添加阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在ImageView(右侧和底部)添加阴影。
下面我发布了2个带阴影效果的图像。
我想要相同的阴影效果。
I want to add a shadow to an ImageView (right and bottom side).
Below I posted 2 images with a shadow effect.
I want the same shadow effect.
如何将此阴影效果应用于我的ImageView?
How can I apply this shadow effect to my ImageView?
带右侧阴影的图像
b $ b
Image with right side shadow
带有右下阴影的图片
image with right and bottom shadow
推荐答案
设置填充大小右下角和背景设置阴影
Set padding size Right and bottom and background set your shadow
<ImageView
android:id="@+id/imageview"
android:background="@drawable/drop_shadow"
<!--android:background="#660000"--> This breaks the syntax highlight
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="10px"
android:paddingBottom="10px"
android:src="@drawable/pic1"
/>
这篇关于为ImageView添加阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文