问题
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:
But when you look at the first character
. It's displaying the wrong image. It supposed to be like this:
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>
回答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" />
来源:https://stackoverflow.com/questions/33217609/how-to-handle-ascii-character-in-android-layout