Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to colour the outline of my text black in xml for android

i want to make the white coloured text in my android app have a black outline. I do not want to colour the textview so if that is your help then no i already know how to do this. I want to make this happen by using a drawable file in xml format. so is there away i can outline the edges of my text in xml?

like image 620
user2357673 Avatar asked Jun 27 '13 13:06

user2357673


1 Answers

One way is to use 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" />

This gives white text a black outline. Adjust the radius accordingly to how thick you'd like it.

like image 180
Ken Wolf Avatar answered Nov 14 '22 23:11

Ken Wolf