Android:如何使TextView的阴影适用于其CompoundDrawable

时间:2014-12-11 04:06:23

标签: android textview

我使用带有复合drawable的TextView,并使用android:shadowColor向TextView添加阴影,但结果是:

enter image description here

如图所示,TextView的文字具有阴影(发光效果),而绘图则没有。

那我该怎么办呢?或者有没有其他方法来实现这种效果?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试以下代码,可能会对您有所帮助

   <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="@string/glow"
android:textSize="80sp"
android:textStyle="bold"
android:textColor="@android:color/white"
android:background="@android:color/black"
android:shadowColor="@color/yellow"
android:shadowDx="0"
android:shadowDy="0"
android:shadowRadius="24"/>

或者您可以参考以下链接,

http://chiuki.github.io/advanced-android-textview/#/