Characters appear out of the screen in the TextView!
Hey, I've been trying to fix this problem for a long time, The problem is that some characters in the text are out of the screen, here is a screenshot of what I mean:
xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/list"
android:orientation="vertical"
android:padding="15dip"
android:layout_width="fill_parent"
android:id="@+id/relativeLayout1"
android:layout_height="fill_parent">
<TextView
android:textSize="20sp"
a开发者_开发技巧ndroid:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000"
android:id="@+id/Munawwat_Text_TextView_text"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
Can anyone suggest a way/workaround to fix this problem?
A workaround for this is to put it into an EditText. If I put the text into the EditText, the EditText gets horizontally scrollable (scrollable for ~3px) which is good so you can see the characters that are out of the screen but i dont want to let the users mess with the text.. So:- Is it possible to not allow the users to edit in the EditText and in the same time let the EditText get scrollable?
- Is there any other view that i can put the TextView into it, so it can get scrollable a bit so I can see the characters? (limit the scroll of the view)
- Is there a way to limit the number of characters in each line in the TextView?
I know I asked a lot though this is one of the last problem I have so I would really appreciate any comment/suggestion! Thanks.
You could wrap your TextView in a ScrollView. Or make the text smaller. Or try adding padding on the left to see if it forces linebreaks.
and try to use weight :D it limites number of caracteres in textview
android:maxLength
精彩评论