11 ScrollView
来源:互联网 发布:大禹 知乎 编辑:程序博客网 时间:2024/05/20 04:30
一.滚动视图ScrollView:
1.说明:
由于手机屏幕高度有限,所以如果面对组件要显示多组信息的时候,
ScrollView视图(滚动视图)可以有效的安排这些组件,浏览的时
可以自动的进行滚屏的操作。
2.定义:
java.lang.Object
|-android.view.View
|-android.view.ViewGroup
|-android.widget.FrameLayout
|-android.widget.ScrollView
3.原理:
滚动视图的使用也各个布局管理器的操作形式类似。唯一不同的是,
所有的布局管理器中,可以包含多个组件,而滚动视图里只能有一个
组件,所以所谓的滚动视图指的就是提供一个专门的容器,这个容器里面可以
装下多余屏幕宽度的组件,而后采用拖拽的方式显示所有在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" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="姓名:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="学号::" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="地址:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="电话:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ni" />
</LinearLayout>
</ScrollView>
1.说明:
由于手机屏幕高度有限,所以如果面对组件要显示多组信息的时候,
ScrollView视图(滚动视图)可以有效的安排这些组件,浏览的时
可以自动的进行滚屏的操作。
2.定义:
java.lang.Object
|-android.view.View
|-android.view.ViewGroup
|-android.widget.FrameLayout
|-android.widget.ScrollView
3.原理:
滚动视图的使用也各个布局管理器的操作形式类似。唯一不同的是,
所有的布局管理器中,可以包含多个组件,而滚动视图里只能有一个
组件,所以所谓的滚动视图指的就是提供一个专门的容器,这个容器里面可以
装下多余屏幕宽度的组件,而后采用拖拽的方式显示所有在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" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="姓名:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="学号::" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="地址:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="电话:" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ni" />
</LinearLayout>
</ScrollView>
- 11 ScrollView
- ScrollView
- ScrollView
- scrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- scrollView
- ScrollView
- ScrollView
- scrollview
- ScrollView
- ScrollView
- scrollView
- 利用jquery的imgAreaSelect插件实现图片裁剪示例
- 10 DatePicker
- php禁止单IP、IP段访问的实现代码
- 嵌入式软件工程师经典笔试题
- struts的s:iterator循环指定次数
- 11 ScrollView
- DAO调用Oracle带自定义类型的存储过程.
- 根据几种典型的WEB服务器应用的特点做出的系统架构建议
- 12 ListView
- HDU1159——Common Subsequence
- mkfifo 创建管道IO 进程间交互
- poj-2516-Minimum Cost-最小费用最大流
- 13 Dialog
- 算法-java版算法竞赛入门解题代码-第3章习题