在界面上水平和竖直方向来滑动图片
(一)垂直滚动:ScrollView
ScrollView 里面只能包含一个控件,它一般用于竖直方向上图片的滑动。
例如:
图片可以上下进行拖动。。。在图片的最右边有滚动条,可以在ScrollView 中
android:scrollbars="none"
在XML中的代码如下:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img7" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img8" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img9" />
<Im