The textview control has a method to control the addition of shadows:
Mtextview. setshadowlayer (10f, 11f, 5f, color. Yellow); the first parameter is The Blur radius, and the greater the Blur. The second parameter is the X horizontal distance from the shadow text. The third parameter is the y horizontal distance from the shadow text. The fourth parameter is the shadow color.
The second method is to separate the style of the textview control into a. xml file for addition.
Res/values/styles. xml
<? XML version = "1.0" encoding = "UTF-8"?> <Resources> <style name = "audiofileinfooverlaytext"> <item name = "Android: paddingleft"> 4px </item> <item name = "Android: paddingbottom "> 4px </item> <item name =" Android: textcolor "> # f1f1f1 </item> <item name =" Android: textsize "> 60sp </item> <item name =" Android: shadowcolor "> # 4d4d4d </item> <item name =" Android: shadowdx "> 0 </item> <item name =" Android: shadowdy ">-3 </item> <item name =" Android: shadowradius "> 3 </item> </style> </resources>
Res/layout/Main. xml
<Textview Android: Id = "@ + ID/tvtest" style = "@ style/audiofileinfooverlaytext" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"/>
Both methods can be implemented.
Note: QQ technology exchange group: add one if you are interested in 108614806.