一、簡(jiǎn)介

二、方法
1)ScrollView垂直滾動(dòng)控件使用方法
1、在layout布局文件的最外層建立一個(gè)ScrollView控件
2、在ScrollView控件中加入一個(gè)LinearLayout控件,并且把它的orientation設(shè)置為vertical
3、在LinearLayout控件中放入多個(gè)裝有圖片的ImageView控件
三、代碼實(shí)例
1、效果圖


2、代碼
/Ex27ScrollView/src/fry/Activity01.java
<?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/item1" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/item2" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/item3" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/item4" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/item5" /> </LinearLayout> </ScrollView>
四、注意點(diǎn)
1、ScrollView控件是放在layout的最外層
2、ScrollView控件中控制進(jìn)度條的屬性android:scrollbars
android:scrollbars="none"
是將滾動(dòng)條設(shè)置為沒(méi)有

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注