Android垂直滚动控件ScrollView使用方法详解

Android垂直滚动控件ScrollView使用方法详解,第1张

概述一、简介二、方法1)ScrollView垂直滚动控件使用方法1、在layout布局文件的最外层建立一个ScrollView控件

一、简介

二、方法

1)ScrollVIEw垂直滚动控件使用方法

1、在layout布局文件的最外层建立一个ScrollVIEw控件

2、在ScrollVIEw控件中加入一个linearLayout控件,并且把它的orIEntation设置为vertical

3、在linearLayout控件中放入多个装有图片的ImageVIEw控件

三、代码实例

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>

四、注意点

1、ScrollVIEw控件是放在layout的最外层

2、ScrollVIEw控件中控制进度条的属性androID:scrollbars

androID:scrollbars="none"

是将滚动条设置为没有

 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程小技巧。

总结

以上是内存溢出为你收集整理的Android垂直滚动控件ScrollView使用方法详解全部内容,希望文章能够帮你解决Android垂直滚动控件ScrollView使用方法详解所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1144809.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存