Disable TabLayout

前端 未结 11 1872
时光说笑
时光说笑 2020-11-29 02:49

I\'m using the new class provided by the design library : TabLayout. And I want in specific cases that the one I\'m using can\'t change tab anymore.

I manage to disa

11条回答
  •  情话喂你
    2020-11-29 03:34

    A good trick you can use :

    create a frame layout that cover the view(s) you want to protect from a click like the following :

    
    

    This code will create and empty/transparent view on top of your view. The android:clickable="true" will intercept the click and prevent the click to go through the view !

    This hack can probably be optimized but its few lines of code to protect multiple view at the same time !

提交回复
热议问题