Search code examples
androidviewflipper

how to add views in viewflipper to the left side in android


I am trying to have a viewflipper which adds imageviews to the left.currently when I addviews to the viewflipper using

viewFlipper.addview (image);

The images are added to the viewflipper on the right side.

child 0->child 1-> child 2-> child 3-> etc

I want to have childviews added to the viewflipper from right to left.

<- child 3 <-child 2 <- child 1 <-child 0

Is there a property which I am missing ? or should it be done explicitly ?


Solution

  • you can use this:

    addView(View child, int index, ViewGroup.LayoutParams params)
    

    or

    addView(View child, int index)
    

    add the view at index 0 to get your desired effect