Android添加垂直滚动ScrollView
来源:互联网 发布:c语言换行符号 编辑:程序博客网 时间:2024/05/23 18:22
Android添加垂直滚动ScrollView
界面的内容太多了,想在Android里面添加滚动效果,就是在LinearLayout外面添加一个ScrollView就行了 。
由:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- tools:context=".MainActivity">
- </LinearLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:scrollbars="vertical"
- android:fadingEdge="vertical">
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- tools:context=".MainActivity">
- </LinearLayout>
- </ScrollView>
结果在第10行11行出现了一个Error:
Unexpected namespace prefix "xmlns" found for tag LinearLayout
后来发现
- xmlns:android="http://schemas.android.com/apk/res/android"
成为:
- <?xml version="1.0" encoding="utf-8"?>
- <ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:scrollbars="vertical"
- android:fadingEdge="vertical">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- tools:context=".MainActivity">
- </LinearLayout>
- </ScrollView>
0 0
- Android添加垂直滚动ScrollView
- Android添加垂直滚动ScrollView
- ScrollView垂直滚动
- Android HorizontalScrollView和ScrollView 水平滚动 垂直滚动
- android 图片垂直方向( ScrollView) ,水平方向HorizontalScrollView 滚动
- Android 垂直与水平滚动条:Scrollview与HorizontalScrollView
- Android项目笔记一:TextView+ScrollView 实现垂直滚动条
- Android 垂直与水平滚动条:Scrollview与HorizontalScrollView
- ScrollView 控件支持垂直滚动
- LinearLayout 添加垂直滚动
- 【Android 开发】:UI控件之 ScrollView垂直滚动控件 和 HorizontalScrollView水平滚动控件的使用
- [Android] ScrollView 垂直滚动控件和 HorizontalScrollView 水平滚动控件的使用
- Android:给对话框AlertDialog添加垂直滚动条
- Android:如何给ScrollView添加滑块滚动条
- Android 垂直滚动条
- Android双向滚动ScrollView
- android scrollview 动态滚动
- Android scrollview 滚动条
- 经典重读《信号与系统》-第二章
- 多态
- 0x80070422 修复方法,
- Swift教程_基础技术(0004)_为animation.timingFunction赋值
- SpringMVC使用进阶-内置对象和跳转
- Android添加垂直滚动ScrollView
- ytaaa
- 使用Hibernate 中的merge()方法
- CImage类的介绍与使用
- OpenGL中的纹理映射
- 自动化安装部署带有HA的OpenStack集群 开源项目 欢迎交流
- 信息安全基础知识(五)主动攻击与被动攻击
- Java并发(具体实例)——构建高效且可伸缩的结果缓存
- 从小白踏上程序员之路