目标
监听ViewPager2里的页面切换事件.
解决方案
vp2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
//xxx
}
})
监听ViewPager2里的页面切换事件.
vp2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
//xxx
}
})
本文标题:安卓ViewPager2监听页面切换事件
本文链接:https://www.haomeiwen.com/subject/biibvktx.html
网友评论