2

Related Question

I do have to show different Ascii character in TextView. Character are:

( `·´ )

(\\/)(°,,,°)(\\/)

( ⚆ _ ⚆ )

If I used above character and display on screen. I got this: enter image description here

But when you look at the first character. It's displaying the wrong image. It supposed to be like this:

enter image description here

I have never worked on Ascii character like this.

Question

How can I handle these type of situations? Is there any libraries exist?

Any help would be appreciable.

Edit-1

layout file

Layout file is a GridView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">
<TextView
    android:id="@+id/img_name"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:padding="8dp"
    android:textSize="30dp" />

</LinearLayout>
Community
  • 1
  • 1

1 Answers1

1

I think you just have to use newlines (\n).

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="(\\/)\n(°,,,°)\n(\\/)"
    android:gravity="center" />
hata
  • 11,633
  • 6
  • 46
  • 69
  • @hata Is this generic solution. I mean what you will do when you have to multiple `Ascii` characters? I mean to say when you will decide when you have to add "\n" because I am getting this data through Json response –  Oct 19 '15 at 15:52
  • @Def If the JSON response itself doesn't contain `\n` or any other line delimiters, I don't think you can know that. – hata Oct 19 '15 at 16:03