Android Custom gallery to disable scrolling

后端 未结 2 780
借酒劲吻你
借酒劲吻你 2021-01-18 20:57

I\'m attempting to create a custom Gallery to disable scrolling. I\'ve got the following from this: how to disable gallery view scrolling

 public class MyGal         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 20:57

    Note the if (isSelected()) clause in example, you might want to omit that and return true unconditionally, completely avoiding inherited implementation.

    Overriding onFling prevents flings but doesn't affect regular scrolling, with finger down. To do that, try also overriding onScroll and immediately returning true from there.

    If that doesn't work either, you can also override onTouchEvent and filter touch events there.

提交回复
热议问题