大纲文字 Android Studio

outline text Android Studio

我一直在寻找如何勾勒出 TextView 的轮廓,到目前为止我刚刚找到 this question,但它是从 2010 年开始的。我认为现在有一种标准的方式来勾勒文本,但到目前为止我没能成功。我的代码如下:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#3e3e3e"
    android:shadowColor="#ffffff"
    />

但是我得到以下渲染错误:

Paint.setShadowLayer is not supported

我很想知道是否有另一种方法来概述文本或如何处理这个错误!谢谢!

尝试设置阴影半径等,只设置颜色不能使阴影出现

示例:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#3e3e3e"
    android:shadowColor="#ffffff"
    android:shadowDx="2"
    android:shadowDy="2"
    android:shadowRadius="1"
/>