onur taskin
onur taskin

Reputation: 929

Android using Scrollview in a scrollview

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?

Upvotes: 2

Views: 1718

Answers (3)

onur taskin
onur taskin

Reputation: 929

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;
}

Upvotes: 9

djr
djr

Reputation: 1

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.

Upvotes: 0

Michael A.
Michael A.

Reputation: 4218

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.

Upvotes: 0

Related Questions