I have a scrollview containing a textview in an Android app. This textview will have text appended to it continuously at set intervals. Scrolling works and the text adds just fine, but what I'd like to do is have the scrollview autoscroll down as text is added. As new text is appended at the bottom, it automatically scrolls down to match and old text is pushed out of sight at the top. What would be even better is to add text to the bottom of the scrollview and have it push older text upward, but one thing at a time.
Open the Activities overview and start typing Mouse & Touchpad. Click on Mouse & Touchpad to open the panel. In the Touchpad section, make sure the Touchpad switch is set to on. Switch the Two-finger Scrolling switch to on.
In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it.
They're completely different. A ScrollView is simple a scrolling container you can use to scroll whatever you put inside it, which might be a list of items, or it might not. A ListView is very specifically designed to hold lists, where items typically look the same (or at least follow a pattern, e.g. section headings).
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:fillViewport="true" > <TextView android:id="@+id/statusText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </ScrollView>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With