마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

ExpandableListActivity 의 ChildView 에 상하 스크롤뷰가 안먹히면 어떻게 하나요?

0 추천
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#999"
        android:clickable="true"
        android:orientation="vertical"
        tools:context=".MainActivity" >

        <ScrollView
            android:id="@+id/scrollView1"
            android:layout_width="match_parent"
            android:layout_height="100dp" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >

                <ImageView
                    android:id="@+id/childImage"
                    android:layout_width="100dp"
                    android:layout_height="200dp"
                    android:layout_margin="5dp"
                    android:background="@drawable/icon"
                    android:contentDescription="@string/hello_world" />

                <TextView
                    android:id="@+id/html"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/hello_world"
                    android:textColor="#FFFFFF"
                    android:textSize="14sp"
                    android:textStyle="bold" />
            </LinearLayout>
        </ScrollView>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@android:color/white" />




    </LinearLayout>

</RelativeLayout>

 

이런식으로 Child xml 을 구현했구요

 

구현된 사진은 

 

이렇게 구현이 되었는데 child view 에서 상하스크롤이 안먹히네요

 

혹시나 해서 좌우 스크롤로 해봣더니 그건 되더라구요...

kmg123 (1,080 포인트) 님이 2014년 12월 25일 질문

2개의 답변

0 추천
 
채택된 답변
requestDisallowInterceptTouchEvent 로 검색해보셔요

터치순간 부모 스크롤뷰의 터치를 막아주면 됩니다.

http://since83com.tistory.com/entry/requestDisallowInterceptTouchEvent-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

http://860709.tistory.com/62
nicehee (73,100 포인트) 님이 2014년 12월 26일 답변
kmg123님이 2014년 12월 30일 채택됨
0 추천
스크롤 가능한 뷰 안에 다른 스크롤 가능한 뷰를 넣으면 정상동작하지 않습니다.

잘 동작하게 하려면 손을 많이 봐야 합니다.

구조를 바꾸세요.
익명사용자 님이 2014년 12월 26일 답변 1 신고
...