jeudi 19 février 2015

Multiple images in image flipper Android

Ok so Im using this code to dynamically pop images on the slider using Image Flipper.


flipper= (ViewFlipper) findViewById(R.id.flipper1);



for(int i=0;i<6;i++)
{
// This will create dynamic image view and add them to ViewFlipper
Button image = new Button(getApplicationContext());

image.setBackgroundResource(R.drawable.stock_bg);
image.setText("Sps"+i);
// image.getLayoutParams().height=40;
// image.getLayoutParams().width=40;
flipper.addView(image);
}


I have set sliding animation to it. The issue is that it fits one image on the whole screen width and then animates to other.. while i want the image size to remain same and it should not fit it to the entire screen. Also note that if i change the flipper width from wrap content to custom width, it will not slide the entire screen. Putting it simple, how can I force the flipper to show more then 1 image on the screen at a time.


Aucun commentaire:

Enregistrer un commentaire