Android Custom gallery to disable scrolling

后端 未结 2 808
借酒劲吻你
借酒劲吻你 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 21:07

    I have use CustomListview in Linearlayout. and disable scrolling using below code

    public void enableDisableView(View view, boolean enabled) {
            view.setEnabled(enabled);
    
            if ( view instanceof ViewGroup ) {
                ViewGroup group = (ViewGroup)view;
    
                for ( int idx = 0 ; idx < group.getChildCount() ; idx++ ) {
                    enableDisableView(group.getChildAt(idx), enabled);
                }
            }
        }
    

提交回复
热议问题