layout上下平滑控制

tags:    時間:2014-05-04 13:22:01
layout左右平滑控制.
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >    <HorizontalScrollView android:layout_width="match_parent"        android:scrollbars="none"        android:layout_height="400dp">        <GridLayout android:layout_width="match_parent"            android:layout_height="match_parent"            android:focusable="true"            android:rowCount="1"            android:id="@+id/main_content">            <LinearLayout android:layout_marginLeft="5dp"                android:orientation="vertical">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                     android:layout_marginTop="5dp"                     android:focusable="true"                     android:clickable="true"                     android:background="@drawable/grid_demo"                     android:src="@drawable/recent"/>                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:clickable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>                      <LinearLayout android:layout_marginLeft="5dp"                android:orientation="vertical">                    <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                  android:orientation="vertical">                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                  android:orientation="vertical">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                  android:orientation="vertical">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                  android:orientation="vertical">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                 android:orientation="vertical">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:layout_marginLeft="5dp"                 android:orientation="vertical">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>             <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical"                  android:layout_marginLeft="5dp">                    <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>                            <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>  <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>              <LinearLayout android:orientation="vertical" android:layout_marginLeft="5dp">                 <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>                  <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                      android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/>            </LinearLayout>        </GridLayout>            </HorizontalScrollView>   <ImageView android:layout_width="200dp"                     android:layout_height="195dp"                     android:focusable="true"                      android:background="@drawable/grid_demo"                     android:layout_marginTop="5dp"                 android:src="@drawable/recent"/> </LinearLayout> 

 

推薦閱讀文章

Bookmark the permalink ,來源:互聯網