Android viewpager图片点击事件

Android 01/19 阅读 855 views次 人气 0
摘要:

代码分享->

在adapter重写instantiateItem方法

--------------------------------------------------------------------------------------------------------------------------------------

@Override
public Object instantiateItem(View container, int position) {
      View view = imageViews.get(position);
      view.setOnClickListener(new OnClickListener() {
           @Override
           public void onClick(View v) {
           // TODO Auto-generated method stub

           }
      });
      ViewPager viewPager = (ViewPager) container;
      viewPager.addView(view);
      return imageViews.get(position);
}

--------------------------------------------------------------------------------------------------------------------------------------

小奋斗文章

--------------------------------------------------------------------------------------------------------------------------------------

评论

该文章不支持评论!

分享到: