开发者

how to add 4 image view to flipper in android?

i want to add 4 imageviews to flipper at a time.Please provide some sample code

my 开发者_JAVA百科code is

    final ImageView imageview=new ImageView(this);
    imageview.setBackgroundResource(R.drawable.img1);       

    final ImageView imageview1=new ImageView(this);
    imageview.setBackgroundResource(R.drawable.img2);

    final ImageView imageview2=new ImageView(this);
    imageview.setBackgroundResource(R.drawable.img3);

    final ImageView imageview3=new ImageView(this);
    imageview.setBackgroundResource(R.drawable.img4);

I want to add these images to flipper on by one.


You want each flipper to contain 4 imageviews?
Create a .xml layout with four imageviews, inflate the view, fetch your imageviews by findViewById and set their source-value then add the inflated view to your flipper with

myFlipper.addView(myInflatedView)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜