Is there a way to add inner shadow to a TextView on Android?

前端 未结 2 679
醉话见心
醉话见心 2020-12-09 05:13

I would like to make an inner shadow on a textview, But I can\'t find any example of that on the web.

Is there any way to do that on Androi

2条回答
  •  粉色の甜心
    2020-12-09 05:26

    If you want the TextView to have inner shadow like this:

    enter image description here

    you have to use 9-patch drawable like this one:

    enter image description here

    Set the 9-patch drawable as the TextView's background.

    The attributes you mention: android:shadowColor, android:shadowRadius, android:shadowDx, android:shadowDy serve other purpose, they create text shadow:

    enter image description here

提交回复
热议问题