Search code examples
androidtextviewstroke

apply stroke on textview in android xml not by canvas


I am unable to find how to achieve stroke on textview from XML , not by canvas.


Solution

  • You can imitate a stroke with a text shadow:

    <TextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:textColor="#FFFFFF"
       android:shadowColor="#000000"
       android:shadowDx="0.0"
       android:shadowDy="0.0"
       android:shadowRadius="2.0" />