I have implemented my own ScrollView that detects when the position of the ScrollView is close to the bottom and add views as necessary. The problem is when I add views to the LinearLayout inside of the ScrollView the scroll jerks to the bottom where I added some views. Is there anyway to add views to a LinearLayout inside a ScrollView that will not cause this behavior?
Thanks
Edit: This seems to only happen while scrolling. I have a case where I add views to the same ScrollView but by clicking a button rather than scrolling and I don't have the jerking problem. The new views just get added to the bottom of the LinearLayout being scrolled.
Related
I have a ScrollView with multiple horizontal RecyclerView. The problem is this:
When I scroll vertically to navigate into my app and I touch on a recyclerview to scroll horizontally, the focus remain on the scrollview and I can't scroll horizontally. I have to release the finger and touch again in order to scroll vertically. I'd like to give proprity to the recyclerview, so I can scroll horizontally without stopping the vertical scroll.
I tried multiples solutions:
editing some parameters in the xml of the recyclerview and its container (focusable, focusableintouchmode, descendantFocusability,nestedscrollingenabled)
adding an ontouchlistener and intercepting the motionevent, both in scrollview and recyclerview
This problem is present using both ScrollView and NestedScrollview and using both RecyclerView and ListView
Thanks for your help
This problem because of recyclerView has default focus.
Just Add this
android:descendantFocusability="blocksDescendants"
to your immediate layout of scrollView.
I have one Fragment and in that I have taken mapview which is inside ScrollView.
While Scrolling the mapview It doesn't scrolling vertically due to it is inside ScrollView, But It scrolls horizontally.
How to avoid this Problem ?
You can add this line on your scrollview in order to allow only vertical scrolling.
android:scrollbars="vertical"
Let me try to explain what I want to achieve. Currently, I have a ScrollView as the main view for my layout and a linearLayout within that to place all of my content into.
In my LinearLayout, I have a bunch of textviews and a gallery, which extends out of the screen, so the user can scroll to see everything. It works.
Now, I want to add an expandableListView to the bottom of all that content, which is still in the linearLayout. The problem is when you expand the list view groups it doesn't affect the ScrollView. I had envisaged that when you expand a group it would make the linearLayout bigger, which in turn makes the scrollview bigger.
Is what I'm thinking achievable?
EDIT:
Ok I think the situation is that listViews are normally placed in a layout by themselves and have scrollviews already enabled. You just set it to fill_parent and it works fine. However, in my case, I'll need the expandableListView to display all content without scrolling, because my ScrollView will deal with that. I don't even think it possible?
It's difficult to answert without seeing your layout xml, but I think that if you set the android:layout_height of the linear layout and expandableListView to wrap_content, the first scrollView must scroll the whole view.
have you tried putting your expandable list into another linear layout and than put it in the scroll views default linear layout?
I have a horizontal scroll view, and inside I have a number of image views, they go across the screen and altogether are wider than the screen.
I've tried to scroll through them using touch, but nothing happens, am I missing something?
Inside HorizontalScrollView, put a LinearLayout with orientation Horizontal and add ImageView to that LinearLayout
I am facing a problem with nested scrollviews in Android.
I have a scrollview(vertical) in a screen as parent scrollview. Inside this parent scrollview I added tw more child scrollviews (both are vertical). When I scroll up or down at any place only parent scrollview is working fine but not in the child views.
Can any one help me in this issue?
You should control the "focusable" and "clickable" parametres. If an item A of the list has a controllable subitem B, the item A can't be controlled.