안드로이드 개발 질문/답변
(글 수 45,052)
한 화면에 listview가 가로로 2개 배치되어있습니다. 예를 들면
lv1 lv2
1 | 2
3 | 4
5 | 6
7 | 8
와 같이 말이죠. 그런데 이렇게 만들면 각각 따로 스크롤이 되어 버립니다.
제가 궁금한 것은 스크롤을 하면 두 리스트뷰가 동시에 스크롤이 되게 하는 방법입니다.
고수분들 부탁드립니다~
lv1 lv2
1 | 2
3 | 4
5 | 6
7 | 8
와 같이 말이죠. 그런데 이렇게 만들면 각각 따로 스크롤이 되어 버립니다.
제가 궁금한 것은 스크롤을 하면 두 리스트뷰가 동시에 스크롤이 되게 하는 방법입니다.
고수분들 부탁드립니다~
2010.04.07 16:35:20
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ListView
android:id="@+id/lv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
<ListView
android:id="@+id/lv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ListView
android:id="@+id/lv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
<ListView
android:id="@+id/lv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
</LinearLayout>
2010.04.07 16:55:41
답변 정말 감사합니다~
근데 정작 문제는 클래스에서
ListView lv1 = (ListView) findViewById(R.layout.위의xml); 로 해야하나요?
클래스에서 위에 적어준 lv1와 lv2과의 연결이 어케 되는지 궁금합니다~
참고로 listactivity 가 아닌 걍 activity를 상속받고 있는 클래스입니다~
근데 정작 문제는 클래스에서
ListView lv1 = (ListView) findViewById(R.layout.위의xml); 로 해야하나요?
클래스에서 위에 적어준 lv1와 lv2과의 연결이 어케 되는지 궁금합니다~
참고로 listactivity 가 아닌 걍 activity를 상속받고 있는 클래스입니다~



