androidscrollbarviewanimator

Showing a scrollbar with a ViewAnimator


I have a view animator that I am adding images to dynamically via a web service call. However, the scroll bar refuses to show up no matter how many pics I add to the ViewAnimator. Thoughts?


Solution

  • The ViewAnimator is not a scrollable layout. Adding a childview to view animator will not show the added view if you don't have a mechanism to call showNext or showPrevious.

    Maybe you want to use a ScrollView instead? You nee to create a ScrollView that contains a LinearLayout with a vertical orientation. You can now add images dynamically to the LinearLayout and the ScrollView will increase in size.