Android控件之ScrollView用法實(shí)例分析
本文實(shí)例講述了Android控件之ScrollView用法。分享給大家供大家參考。具體如下:
ScrollView滾動視圖是指當(dāng)擁有很多內(nèi)容,屏幕顯示不完時,需要通過滾動跳來顯示的視圖。
ScrollView只支持垂直滾動。
以下為案例
main.xml布局文件:
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/p1" android:layout_gravity="center_horizontal"/> </LinearLayout> </ScrollView>
顯示效果如下圖所示:
希望本文所述對大家的Android程序設(shè)計有所幫助。
- Android 自定義 HorizontalScrollView 打造多圖片OOM 的橫向滑動效果(實(shí)例代碼)
- android 自定義ScrollView實(shí)現(xiàn)背景圖片伸縮的實(shí)現(xiàn)代碼及思路
- Android中實(shí)現(xiàn)監(jiān)聽ScrollView滑動事件
- android TextView不用ScrollViewe也可以滾動的方法
- 在android中ScrollView嵌套ScrollView解決方案
- android 實(shí)現(xiàn)ScrollView自動滾動的實(shí)例代碼
- Android之ScrollView嵌套ListView和GridView沖突的解決方法
- android開發(fā)教程之文本框加滾動條scrollview
- Android ScrollView滑動實(shí)現(xiàn)仿QQ空間標(biāo)題欄漸變
- Android自定義scrollView實(shí)現(xiàn)頂部圖片下拉放大
相關(guān)文章
Android 自定義圓形帶刻度漸變色的進(jìn)度條樣式實(shí)例代碼
這篇文章主要介紹了Android 自定義圓形帶刻度漸變色的進(jìn)度條的實(shí)例代碼,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-11-11Android圖片上傳實(shí)現(xiàn)預(yù)覽效果
這篇文章主要介紹了Android圖片上傳實(shí)現(xiàn)預(yù)覽效果的相關(guān)資料,需要的朋友可以參考下2016-01-01淺析Android App的相對布局RelativeLayout
這篇文章主要介紹了Android App的相對布局RelativeLayout,文中舉了一個登錄界面的XML布局例子,非常直觀,需要的朋友可以參考下2016-04-04Bootstrap 下拉菜單.dropdown的具體使用方法
這篇文章主要介紹了Bootstrap 下拉菜單.dropdown的具體使用方法,詳細(xì)講解下拉菜單的交互,有興趣的可以了解一下2017-10-10Android 從底部彈出Dialog(橫向滿屏)的實(shí)例代碼
在android開發(fā)中經(jīng)常會遇到底部彈出框的功能,今天小編抽時間給大家整理一個底部彈出橫向滿屏的dialog,需要的朋友參考下2016-11-11Android?XML數(shù)據(jù)解析要點(diǎn)介紹
這篇文章主要為大家介紹了Android?XML數(shù)據(jù)解析要點(diǎn)介紹,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04Android 動畫之AlphaAnimation應(yīng)用詳解
本節(jié)講解AlphaAnimation 動畫,窗口的動畫效果,淡入淡出什么的,有些游戲的歡迎動畫,logo的淡入淡出效果就使用AlphaAnimation,具體的祥看本文,需要的朋友可以參考下2012-12-12