android学习笔记11——ScrollView
2024-10-08 22:52:59
ScrollView——滚动条
用于内容显示不全,可提供滚动条下来形式,显示其余内容。
ScrollView和HorizontalScrollView是为控件或者布局添加滚动条
特点如下:
1.只能有一个子控件
2.两个控件可以互相嵌套
3.ScrollView派生子FrameLayout
4.ScrollView——垂直滚动条;HorizontalScrollView——水平滚动条
5.属性scrollbars 可以设置滚动条的方向:但ScrollView设置为horizontal/none效果相同,HorizontalScrollView设置为vertical和none的效果相同
实例如下:
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" > <LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="0001" /> <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="0001" /> //足够多控件
....... </HorizontalScrollView>
允许效果:略
需要看ScrollView效果需将布局文件内容跟标签更改为“ScrollView”,同时修改线性布局控件的布局方式为垂直,即可......
最新文章
- 深入理解 JavaScript,以及 Linux 下的开发调试工具
- DevExpress v16.1.5图表、Dashboard等多个控件API发生变化
- c++打开浏览器
- json转类
- Mockups Mockplus 网页原型设计
- JavaScript进阶(三)之对象
- debug实战:Unmanaged High Memory非托管高内存
- 20145222黄亚奇《Java程序设计》课程总结
- 读loadBalance技术的一些笔记
- Linux内核加载全流程
- 在百万数据中找出重复的数据sql
- CentOS 6.5 伪分布式 安装 hadoop 2.6.0
- 第二天(CSS 选择器)
- Motrix for Mac(百度网盘加速/全能下载软件) v1.3.7最新版!
- nginx~为docker容器添加负载均衡
- block,inline,inline-block区别
- selenium新手常遇到的坑
- 在centos7 部署bbr
- SpringMVC Get请求传集合,前端";异步";下载excel 附SpringMVC 后台接受集合
- 单源最短路径算法——Bellman-ford算法和Dijkstra算法