我找到了解决问题的方法,我会在这里发布答案给需要的人
tv.setShadowLayer(
10f, // radius: The radius of the shadow
0f, // dx: The horizontal offset of the shadow
0f, // dy: The vertical offset of the shadow
Color.RED // shadowColor: The color of the shadow
)
// You can also customize other properties of the TextView
tv.setTypeface(null, Typeface.BOLD)