Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TextView Wrap

Here is my problem. How to make text don't wrap?

I already tried to make text smaller. Didn't work. Tried to do singleline="true". Here is what he do(2 screen shot 6-7 textview)

1 Screenshot) Here is I made it in the Eclipse

2 Screenshot) Here is how it showen in the emulator

Here is I made it in the EclipseHere is how it showen in the emulator

like image 522
Sergio Avatar asked Jun 06 '11 12:06

Sergio


People also ask

What is Ellipsize?

Android Ellipsize Android TextView ellipsize property Causes words in the text that are longer than the view's width to be ellipsized ( means to shorten text using an ellipsis, i.e. three dots …) instead of broken in the middle to fit it inside the given view.

What is wrapped text in Excel?

In Microsoft Excel and other spreadsheet programs, Wrap Text is a feature that shows all information in a cell, even if it overflows the cell boundary. For example, the image shows that cell G2 has text that is cut off because the adjacent cell H2 has text.


2 Answers

Try setting android:ellipsize to none for each TextView. For more details see documentation on this attribute.

From xml:

<TextView ... android:ellipsize="none" />

From code:

 TextView textView = new TextView(context);
 ...
 textView.setEllipsize(null);
like image 89
inazaruk Avatar answered Oct 04 '22 04:10

inazaruk


try giving android:maxLines=1... singleLine property should also work...

like image 29
ngesh Avatar answered Oct 04 '22 02:10

ngesh