我想知道如何使文字在android中发光,我知道如何通过具有某些属性的xml进行操作,如下所示:
android:shadowColor="#6A8B00"
android:shadowDx="3"
android:shadowDy="3"
android:shadowRadius="10"
android:text="@string/glowText"
android:textColor="#E15529"
android:textSize="30sp"
但是我想通过代码来完成,那么我可以更好地控制并在不同情况下或多或少地产生光晕。也许有像view.setGlow这样的东西?
您可以setShadowLayer (float radius, float dx, float dy, int color)
在textview上使用。例如:
textView.setShadowLayer(30, 0, 0, Color.RED);
在TextView文档中找到
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句