這里的addView和removeView總是報錯
@Override public?Object?instantiateItem(View?container,?int?position)?{ container.addView(viewList.get(position)); return?viewList.get(position); //?TODO?Auto-generated?method?stub } @Override public?void?destroyItem(View?container,?int?position,?Object?object)?{ //?TODO?Auto-generated?method?stub container.removeView(viewList.get(position)); } }
報錯報告為:
Multiple markers at this line
- The method addView(View) is undefined for the type View
- The method addView(View) is undefined for the type Object
Multiple markers at this line
- The method removeView(View) is undefined for the type View
- The method removeView(View) is undefined for the type View
2016-03-29
感覺還是很有幫助的
2015-11-09
同問,我的重寫的方法里參數就是View 類型啊。每次都需要手動修改
2015-06-25
同問?。?!,怎么選擇ViewGroup類型的參數呀,重寫的方法里只有View類型的啊?
2015-06-09
public void destroyItem(ViewGroup container, int position, Object object)
2015-06-09
public Object instantiateItem(ViewGroup container, int position)
參數選的不對,應該選擇這個含有ViewGroup參數的