1

I am developing an Android application that needs to have this kind of TextView as shown in the image, actually I am trying to add this highlighting effect by using various shadow properties in TextView but nothing is working. In my image i need to have white background behind each character.

Here is my TextView code:

<TextView
        android:id="@+id/textpage"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:gravity="center|center_horizontal"
        android:shadowColor="#FFFFFF"
        android:shadowDx="-0.5"
        android:shadowDy="0.5"
        android:shadowRadius="10"
        android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. "
        android:textColor="#050505"
        android:textSize="16sp"
        android:layout_marginTop="30dp" />

Here is TextView image that i need to make:

Textview

David Ferenczy Rogožan
  • 23,966
  • 9
  • 79
  • 68
Sidhi Tare
  • 11
  • 2

1 Answers1

0

you can use like in case of changing font

 textView.setTypeface(Typeface.DEFAULT, Typeface.BOLD);

and other way is you can downloadAnyFont.ttf file and put it in asset folder and use like as this

You can download your specified font from Free fonts
//Download the requied font

Typeface type=Typeface.createFromAsset(context.getAssets(),
    "YourDownloadedfont.ttf");  // Use Download font and paste name at YourDownloadedfont.ttf
textView.setTypeface(type, null);

This may be the real solution for you:

please view these link for detail
MagicTextView
Customize Android Fonts
Android textview outline text

These will give you idea.
May this solve your problem.

Community
  • 1
  • 1
Ravikant Paudel
  • 2,228
  • 2
  • 17
  • 28