有没有一种方法,以内侧阴影添加到Android上一个TextView?阴影、方法、TextView、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 t...

我想在的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:

阅读全文

相关推荐

最新文章