1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 ~ Copyright (C) 2014 The Android Open Source Project 4 ~ 5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 ~ you may not use this file except in compliance with the License. 7 ~ You may obtain a copy of the License at 8 ~ 9 ~ http://www.apache.org/licenses/LICENSE-2.0 10 ~ 11 ~ Unless required by applicable law or agreed to in writing, software 12 ~ distributed under the License is distributed on an "AS IS" BASIS, 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ~ See the License for the specific language governing permissions and 15 ~ limitations under the License. 16 --> 17 18 <!-- XML for screen that holds various scroll views. --> 19 20 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 21 android:layout_width="fill_parent" 22 android:layout_height="fill_parent" 23 android:fillViewport="true" 24 android:orientation="vertical" > 25 26 <LinearLayout 27 android:layout_width="fill_parent" 28 android:layout_height="wrap_content" 29 android:orientation="vertical" > 30 31 <TextView 32 android:id="@+id/top_left" 33 android:layout_width="wrap_content" 34 android:layout_height="wrap_content" 35 android:layout_marginTop="10dp" 36 android:text="top_left" /> 37 38 <ScrollView 39 android:layout_width="fill_parent" 40 android:layout_height="50dp" 41 android:layout_marginTop="10dp" 42 android:background="#FFDDDDDD" 43 android:fillViewport="true" 44 android:orientation="vertical" > 45 46 <LinearLayout 47 android:layout_width="wrap_content" 48 android:layout_height="wrap_content" 49 android:orientation="vertical" > 50 51 <TextView 52 android:id="@+id/double_scroll" 53 android:layout_width="wrap_content" 54 android:layout_height="wrap_content" 55 android:layout_marginTop="200dp" 56 android:text="double_scroll" 57 android:textColor="#000000" /> 58 </LinearLayout> 59 </ScrollView> 60 61 <!-- Keep this on bottom to test scrolling to views that are not showing. --> 62 <!-- Huge top margin to guarantee this being out of view on large screen layout. --> 63 64 <HorizontalScrollView 65 android:layout_width="fill_parent" 66 android:layout_height="50dp" 67 android:layout_marginTop="3000dp" 68 android:background="#FFDDDDDD" > 69 70 <LinearLayout 71 android:layout_width="wrap_content" 72 android:layout_height="wrap_content" 73 android:orientation="horizontal" > 74 75 <TextView 76 android:id="@+id/bottom_left" 77 android:layout_width="wrap_content" 78 android:layout_height="wrap_content" 79 android:text="bottom_left" 80 android:textColor="#000000" /> 81 82 <TextView 83 android:id="@+id/bottom_right" 84 android:layout_width="wrap_content" 85 android:layout_height="wrap_content" 86 android:layout_marginLeft="3000dp" 87 android:text="bottom_right" 88 android:textColor="#000000" /> 89 </LinearLayout> 90 </HorizontalScrollView> 91 </LinearLayout> 92 93 </ScrollView> 94