如何手动选择页面查看器位置的滑动图像?

时间:2015-12-09 05:36:59

标签: android

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
    View itemView = mLayoutInflater.inflate(R.layout.viewpager_item, container, false);

    ImageView imageView = (ImageView) itemView.findViewById(R.id.imageView);

    if(count== 1){
        imageView.setImageResource(mThumbIds[firstposition]);
        count++;
        position=firstposition;

    }
    else
    {
        imageView.setImageResource(mThumbIds[position]);

    }

    container.addView(itemView);

    return itemView;
}

0 个答案:

没有答案