简体   繁体   中英

Scrollview inside scrollview in android

I am having scrollview inside another scrollview. I want to scroll inner scrollview but outer scrollview is only scrolled.how to solve this problem?

Thanks.

    sv01 = (ScrollView) findViewById(R.id.popup_sf_event_scroll_01);
    sv02 = (ScrollView) findViewById(R.id.popup_sf_event_scroll_02);

    sv02.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_UP)
                sv01.requestDisallowInterceptTouchEvent(false);
        else 
                sv01.requestDisallowInterceptTouchEvent(true);

        return false;
        }
    });

in scroll view take one layout and add another scrollview in that layout coz scrollview can hold only one child in it. So that inner scrollview can move for what it is holding in it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM