Search code examples
javaandroidandroid-studiocolorsbackground-color

custom text style with two color


I want know it's possible to style text like this:

Text style example

Note : I am using shadow but it doesn't seem useful to me. I would like to get a two color text like in the picture above.

This is my code:

<com.example.fabulous.comic.CustomTXT
    android:textColor="@color/white"
    android:shadowColor="@color/blacke"
    android:layout_margin="2dp"
    android:id="@+id/txt"
    android:text="hellow"
    android:layout_width="match_parent"/>
    android:layout_height="wrap_content"/>

Solution

  • Yes you can create text like this see my previous detail answer here.

    Set text color to white and outline color toblack.