0

I am trying my best increasing border width of characters on textview but i haven't founded anything like following. As you can see, outlined borders are black in order to constrast with backgrounds. So, how can i do something like that? I mean, i would like to do this with .xml or .java

Outlined black

enter image description here

Jose
  • 87
  • 1
  • 8
  • try to add shadow: https://stackoverflow.com/questions/2486936/android-shadow-on-text – Pooya Jul 13 '17 at 19:26
  • thanks but this is not drawing black outline, this is adding shadow – Jose Jul 13 '17 at 19:43
  • 1
    Maybe this will help you: https://stackoverflow.com/questions/1723846/how-do-you-draw-text-with-a-border-on-a-mapview-in-android#answer-2151964 – Tharkius Jul 13 '17 at 19:54

2 Answers2

1

You can download the font type and add it to the items you need

https://i.stack.imgur.com/i6XNU.png

Select File / New Folder / Assets Folder

Right click on assets and create a folder called fonts

Put your font file in assets > fonts

Use this

    TextView myTextView = (TextView) findViewById(R.id.textView);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/yourfont.ttf");
    myTextView.setTypeface(typeface);
Woz
  • 350
  • 7
  • 13
  • I have been trying this too and i think is the best option, but i am still wondering which is the correct way to do this programatically – Jose Jul 13 '17 at 22:11
0

You can set shadow for your textview using attributes below.

android:shadowColor="@color/black"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"

For more information link

Fatih Santalu
  • 4,641
  • 2
  • 17
  • 34