Disable swiping between tabs

后端 未结 4 490
不知归路
不知归路 2020-12-04 17:47

I set up sliding tabs with two Fragments each Fragment has a Button which goes to a WebView. The problem with this is whe

4条回答
  •  鱼传尺愫
    2020-12-04 18:23

    Kotlin:

    Using ViewPager2...

    viewPager.isUserInputEnabled = false
    

    Swiping between tab is disabled and the user can still tap tabs at the top to go between tabs.

    Documentation on isUserInputEnabled

提交回复
热议问题