0

Possible Duplicate:
Can I scroll a ScrollView programmatically in Android?

I have a chat program that adds chats to a text view inside a scroll view. The bottom represents the last chat. I wanted to have it so each time new chts whhere added, it would scroll down.

When I looked into the sdk there was a function called setVerticalScrollPos, but the documentation says it needs sdk 11, which is android 3.0.

Quastion, 1. Is there a way to set the vertical scroll pos in android 2.0 2. Right now my development environment is set to android 3.0, (because of the ads)but my target market is 2.0 and above. I test run it on my android device which is 2.0. Can my code call setVerticalScrollPos while it is running on a android 2.2? Or maybe I could have a if then to only call the method for android 3.0 or higher devices?

Community
  • 1
  • 1
Ted pottel
  • 6,869
  • 21
  • 75
  • 134

1 Answers1

0

There is no method in the SDK called setVerticalScrollPos(), even in 3.0, but no matter.

scrollTo() and smoothScrollTo() have been in the SDK since the beginning and can be called on any view (the smooth variant animates the scroll).

HTH

devunwired
  • 62,780
  • 12
  • 127
  • 139