android - ClickListener in ScrollView intercepts scrolling -


i have 2 rows of imageviews in scrollview. imageviews have onclicklistener , when want scroll in area doesn't work. guess click listeners intercept scrolling of scrollview. what's best way change behaviour ? view hierarchy this:

<scrollview>   <relativelayout>     <framelayout>     </framelayout>   <relativelayout> </scrollview> 

in framelayout put fragment has linearlayout in inflate other linearlayouts this:

 productholder.productlayout.setonclicklistener(new view.onclicklistener() {                 @override                 public void onclick(final view v) {                  }             }); 

maybe use ontouchlistener instead of onclicklistener.

in ontouchlistener can check if action of motion event click , consume event (return true). otherwise can leave event other listeners (return false) consume.

note, might need add additional implementation figuring out image view clicked, without seeing layout, it's hard give hint how it.


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

collision detection - C++ library for mesh to mesh intersection: what is available? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -