2

I want to create a TextView that does NOT wrap text, and allow vertical/horizontal scrolling? The solution described here no longer works on 4.0.3.

Is there any solution for 4.x?

1
  • The TextView wraps the words. Commented Aug 27, 2012 at 16:24

1 Answer 1

5

Wrap your text in a HorizontalScrollView for horizontal scrolling:

 <?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/text_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="false" android:maxLines="3" android:scrollbars="vertical" android:textColor="@android:color/secondary_text_dark_nodisable" > </TextView> </HorizontalScrollView> 

For vertical scrolling use ScrollView.

Also, this XML was just grabbed from the answer you referenced.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.