主要涉及到子Scrollview监测父Scrollview的点击事件,做相应的响应。
- <ScrollView
- android:id="@+id/scrollview_f"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:fadingEdge="none"
- android:scrollbars="none" >
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <com.example.view.ChildScrollview
- android:id="@+id/scrollview_c"
- android:layout_width="fill_parent"
- android:layout_height="80dp"
- android:layout_gravity="center"
- android:fadingEdge="none"
- android:scrollbars="none"
- android:visibility="visible" >
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="80dp"
- android:gravity="center"
- android:scrollbars="vertical" >
- <TextView
- android:id="@+id/tv_test"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="top"
- android:scrollbars="vertical"
- android:singleLine="false"
- android:background="@null"
- android:text="Test\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\n" />
- </LinearLayout>
- </com.example.view.ChildScrollview >
- </LinearLayout>
- </ScrollView>