有没有一种方法,以内侧阴影添加到Android上一个TextView? [英] Is there a way to add inner shadow to a TextView on Android?
问题描述
我想在的TextView
作出内阴影
,但我找不到任何例子即在网络上。
I would like to make an inner shadow
on a textview
, But I can't find any example of that on the web.
有没有办法做到这一点在Android?
Is there any way to do that on Android?
我知道这些属性:
android:shadowColor
android:shadowRadius
android:shadowDx
android:shadowDy
我失去了一些有用的东西?
Am I missing something useful?
推荐答案
如果你想在的TextView
有内阴影是这样的:
If you want the TextView
to have inner shadow like this:
您必须使用9补丁绘制像这样的:
you have to use 9-patch drawable like this one:
设置9补丁绘制作为TextView的背景。
Set the 9-patch drawable as the TextView's background.
你提到的属性:安卓则shadowColor,机器人:shadowRadius,机器人:shadowDx,Android的:
服务于其他目的shadowDy,他们创造文字阴影:
The attributes you mention: android:shadowColor, android:shadowRadius, android:shadowDx, android:shadowDy
serve other purpose, they create text shadow:
这篇关于有没有一种方法,以内侧阴影添加到Android上一个TextView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!