Extremely frustrating = TextView in ScrollView -> Scroll to bottom?

by skink » Thu, 28 May 2009 16:52:16 GMT


Sponsored Links
 On 28 Maj, 01:28, "Peter Carpenter"



try:
tv.setText(s);
sv.post(new Runnable() {
    void run() {
        sv.scrollTo(0, yPosition);
    }
});










--~--~---------~--~----~------------~-------~--~----~



Extremely frustrating = TextView in ScrollView -> Scroll to bottom?

by Peter Carpenter » Fri, 29 May 2009 07:50:43 GMT


 Oh dear...
I should have tried that first.  It works beautifully!
Thanks very much skink.  I wasn't able to get the Selection.SetSelection
to work even if I posted it later.  There's obviously something I don't
quite understand about how all of this works. - Like why I need to put a
TextView that supports scrolling inside a scrollview to do this
anyway... :S

After experimenting a bit more I was only able to get the following 2
commands to work:

sv.post(new Runnable() {
    public void run() {
        sv.scrollTo(0, tv.getHeight());
    }
});

And 

sv.post(new Runnable() {
    public void run() {
        sv.fullScroll(ScrollView.FOCUS_DOWN);
    }
});

Thanks skink & Raphael

-----Original Message-----
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of skink
Sent: Thursday, 28 May 2009 6:52 PM
To: Android Developers
Subject: [android-developers] Re: Extremely frustrating = TextView in
ScrollView -> Scroll to bottom?




On 28 Maj, 01:28, "Peter Carpenter"



try:
tv.setText(s);
sv.post(new Runnable() {
    void run() {
        sv.scrollTo(0, yPosition);
    }
});













--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Java thread vs. native thread

Does anyone know how Java thread relates to Android native thread?
Does it map one to one?

-- 

2. I want to join the group

HI,
   please let me join .
   thanks very much

-- 

3. Getting errors in integrating older ans newer Contacts APIs in single App

4. rtsp video frame rate loss?

5. which android dev phone to buy? (preferably with keyboard)

6. skim for android

7. Android rtsp video frame rate loss?