我想知道如何在android的文本上添加阴影?
我有以下代码,这是应用于一个位图,我想被阴影…
paint.setColor(Color.BLACK);
paint.setTextSize(55);
paint.setFakeBoldText(false);
paint.setShadowLayer(1, 0, 0, Color.BLACK); //This only shadows my whole view...
发布于 2017-04-03 18:51:29
如果你想实现像Android在启动程序中那样的阴影,我们正在管理这些值。如果你想创建一个没有背景的TextViews,它们是很有用的。
android:shadowColor="#94000000"
android:shadowDy="2"
android:shadowRadius="4"
发布于 2017-12-06 23:43:14
<style name="WhiteTextWithShadow" parent="@android:style/TextAppearance">
<item name="android:shadowDx">1</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">1</item>
<item name="android:shadowColor">@android:color/black</item>
<item name="android:textColor">@android:color/white</item>
</style>
然后将其用作
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
tools:text="Today, May 21"
style="@style/WhiteTextWithShadow"/>
发布于 2010-03-21 21:55:40
绘制两个文本:一个灰色(它将是阴影),并在它的顶部绘制第二个文本(y坐标比阴影文本多1px )。
https://stackoverflow.com/questions/2486936
复制相似问题