Android ViewPager get the current View

前端 未结 15 2402
天命终不由人
天命终不由人 2020-11-28 06:24

I have a ViewPager, and I\'d like to get the current selected and visible view, not a position.

  1. getChildAt(getCurrentItem) returns wrong Vi
15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 06:39

    Please check this

    ((ViewGroup))mViewPager.getChildAt(MyActivity.mViewPager.getCurrentItem()));
    

    else verify this link.

提交回复
热议问题