[ACCEPTED]-Android TextView Scrollable-textview
Accepted answer
In your XML layout file:
<TextView
android:id="@+id/message_scroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:text="@string/lorem" />
In your Java class 1 file:
TextView tv = (TextView) rootView.findViewById(R.id.message_scroll);
tv.setMovementMethod(new ScrollingMovementMethod());
Wrap your textview in a scrollview:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:maxLength="16"
android:scrollbars = "vertical"
android:ellipsize="end"
android:text="fdgdddhhhdhd" />
</ScrollView>
0
Your android:maxlength="16" limits 2 the number of characters that can be placed 1 in the TextView to 16
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.