Android GridView in a scroll view -
I have a layout for which I need to insert a grid view inside the scroll view, I have read this but my suggestion It is not necessary for the layout.
When a GridView
is inserted in a ScrollView
the grid is not scrolled! I have got this with regard to the following.
The problem I have is that I will not scroll the grid view smoothly, if I hold my finger and drag it scroll, but if I type a gesture, it's expected to be a smooth As soon as I scroll off my finger stops on the grid view.
gridView.setOnTouchListener (New View.OnTouchListener () {@Override Public Boolean onTouch (see v, MotionEvent event) {if (event.getAction () == MotionEvent.ACTION_DOWN || event. GetAction () == MotionEvent.ACTION_MOVE) {gridView.requestDisallowInterceptTouchEvent (true);} return false;}});
I tried, but no luck adding this
gridView.setOnScrollListener (New OnScrollListener () {@Override Public Zero onScrollStateChanged (AbsListView View, Int scrollState) {// TODO Automatic Created Method // Stub} @Override Public Zero Onscroll (AbsListView view, integer firstVisibleItem, integer visibleItemCount, integer totalItemCount) {// TODO Automatic Created Method Stub gridView.requestDisallowInterceptTouchEvent (right) ;}});
Edit:
To give just a bit more information
Grid view program is inserted into a relative layout that sits in a linear Inside, the layout inside a scrollview
I will suggest you to use it. It works great for me. If it will help you :)
Comments
Post a Comment