【发布时间】:2021-12-17 16:21:22
【问题描述】:
有没有办法将 shadowRadius 应用于 Android 中的透明 ImageView?对于 TextView,以下工作:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:shadowColor="@color/textShadowColor"
android:shadowRadius="15"
android:shadowDx="0"
android:shadowDy="0" />
如何在 Android 中为放置在文本旁边的箭头图标实现相同的效果?在 iOS 中,以下工作开箱即用:
Image("arrow")
.shadow(color: textShadowColor, radius: textShadowRadius, x: 0.0, y: 0.0)
Text("my text")
.shadow(color: textShadowColor, radius: textShadowRadius, x: 0.0, y: 0.0)
【问题讨论】:
-
您想让箭头本身投下阴影吗?还是imageview的轮廓?是位图还是矢量?
-
箭头本身,效果和文字一样。这是一个png。
-
这在 Android 中可能是可行的。这种效果是应用于不确定数量的 PNG 还是预先知道的有限数量?如果事先知道,您可以简单地使用 Adobe Illustrator 或 Gimp 来制作阴影并将它们存储在您的 APK 中。
-
> “这在 Android 中可能是可行的。”我正在等待所有 Android 专家来阐明它。