I have a ScrollView with a TextView inside of it. I want to make sure that the app automatically scrolls down to the bottom each time text is entered into the TextView.
<ScrollView
android:id="@+id/textScroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/gridLayout"
android:layout_marginBottom="100dp"
android:fillViewport="true">
<TextView
android:id="@+id/numerTV"
android:layout_width="match_parent"
android:layout_height="70dp"
android:textSize="60sp"/>
</ScrollView>
So this is the .xml file. I have tried a lot of different solutions that I've found around here:
textScroll.post(new Runnable() {
@Override
public void run() {
textScroll.scrollTo(0, textScroll.getBottom());
//textScroll.post(new Runnable() {
//public void run() {
// textScroll.fullScroll(View.FOCUS_DOWN);
// }
// });
Log.d("Scroll","Scrolling");
}
});
Also tried to set autoscroll via xml but nothing works.
Any ideas what I'm doing wrong? How come the "solution" above works for so many but not for me?
Help much appreciated!