在使用PagerAdapter的时候,会有instantiateItem函数需要自己去重写。

最后一句   假如写成

((ViewPager) container).addView(v, position);

会报错 :IndexOutOfBoundsException

将position 改成 0  就可以啦

((ViewPager) container).addView(v, 0);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-12-13
  • 2022-12-23
  • 2021-11-08
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-01-21
  • 2022-01-01
相关资源
相似解决方案