안드로이드 개발 질문/답변
(글 수 45,052)
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vscroll"
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/context_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/context_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
TableLayout 안에 TableRow는 자바 코드에서 동적으로 돌려서 생성할건데요
이런 xml 소스를 이용해서 자바 코드에서..
context_1는 스크롤이 불가능
context_2는 스크롤이 가능
하게 할 수 있나요??
밖으로 뺀다던지 이런거 말고요;; 이 폼 안에서
2012.07.24 12:10:09
말씀하시는 스크롤이라는게 모두를 둘러싼 전체 스크롤이고.
다만 왼쪽영역(context_1)으로는 스크롤이 안되고 오른쪽 영역(context_2)으로는 스크롤이 되도록 하는것을 말씀하시는건가요? 아니시라면 아래 답변은 패스 :)
만약 그러하다면 ScrollView를 상속받으셔서 onTouch를 오버라이드하여 기본동작을 없애시고
해당 뷰가 있는 activity의 onTouchEvent를 상속하여 touch 영역이 context_2에서 시작한 move 이벤트라면 변경된y좌표 만큼의 스크롤을 이동하도록 하면 되지 않을까 싶네요.




안되죠.