0
我想显示像阴影效果的3D图像,请帮助我如何将阴影效果追加到android中的imageview?
我想显示像阴影效果的3D图像,请帮助我如何将阴影效果追加到android中的imageview?
在res - > drawable文件夹下创建一个xml布局文件。让我们将它命名为“image_shadow.xml”,然后将下面的代码复制到它。
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape
android:shape="rectangle">
<solid android:color="@android:color/darker_gray" />
<corners android:radius="0dp"/>
</shape>
</item>
<item android:right="1dp" android:bottom="2dp">
<shape
android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="1dp"/>
</shape>
</item>
</layer-list>
然后在您ImageView
作为
android:background="@drawable/image_shadow
希望它可以帮助你运用它。
感谢您的帮助 –
总是乐于助人。如果对你有帮助,请接受我的回答! – itzswan