2

when i tried to use scrollview or webview in a scrollview, the inside scrollview or webview can not scroll. I can scroll with trackball but I can't scroll with touch. Do you have any idea about this issue?

3 Answers 3

9

I found something and it works for me. I wanted to share. Here it is, I have one scrollview and listview. listview inside scrollview. Scrollview-> RelativeLayout-> Listview. That listener belongs to Listview;

@Override
public boolean onTouch(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_MOVE) {
        ScrollView().requestDisallowInterceptTouchEvent(true);
    }
    return false;
}
Sign up to request clarification or add additional context in comments.

2 Comments

oops thanks a lot, for the last 3 hrs I have been trying to solve this issue. Almost I tried everything like customizing the scrollview, ontouch event, sv inside sv, list inside sv, onscroll(), onscrollchanged() but nothing worked for me. your soution worked. thank u so much.
You mean requestDisallowInterceptTouchEvent(false); no?
0

Android does not support using ScrollViews or ListViews inside each other. It's possible to do, but it's A Bad Thing (TM), according to Google developers.

Search SO for similar problems with ListViews, and you'll find several discussions + suggestions on how to hack around the limitations of the OS. However, I would strongly suggest you reconsider your layout to try and find some other way to handle your layout.

Comments

0

ScrollView supports only one direct child; it can be either a LinearLayout or a RelativeLayout. If you have more than one children the scroll wouldn't work properly.

1 Comment

My layout architecture like this RealtiveLayout -> Scrollview -> Relativelayout->(childs) + relativeLayout -> scrollview -> RelativeLayout -> childs . So i guess that isn't the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.