Android 滚动视图(ScollView)
1.介绍
2.使用技巧
3.xml文件代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"> <ScrollView
android:layout_width="match_parent"
android:layout_height="300dp"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"> <TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" /> <ImageView
android:id="@+id/imageView"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img01" />
<ImageView
android:id="@+id/imageView2"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img02" /> <ImageView
android:id="@+id/imageView3"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img03" /> <ImageView
android:id="@+id/imageView4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img04" /> <ImageView
android:id="@+id/imageView5"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img05" />
<ImageView
android:id="@+id/imageView6"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img06" />
<ImageView
android:id="@+id/imageView7"
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_weight="1"
app:srcCompat="@mipmap/img07" /> </LinearLayout>
</ScrollView> <HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"> <TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" /> <ImageView
android:id="@+id/imageView9"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img01" /> <ImageView
android:id="@+id/imageView10"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img02" /> <ImageView
android:id="@+id/imageView11"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img03" /> <ImageView
android:id="@+id/imageView12"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img04" /> <ImageView
android:id="@+id/imageView13"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img05" /> <ImageView
android:id="@+id/imageView14"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img06" /> <ImageView
android:id="@+id/imageView15"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:layout_weight="1"
app:srcCompat="@mipmap/img07" />
</LinearLayout>
</HorizontalScrollView> </LinearLayout>
Android 滚动视图(ScollView)的更多相关文章
- Anroid组件滚动视图(ScollView)简单使用
ScollView应用展示 在xml文件中添加滚动视图 activity_main.xml <?xml version="1.0" encoding="utf-8& ...
- Android——滚动视图(ScrollView)图片视图(ImageView)、状态开关按钮(ToggleButton)、时钟
xml <?xml version="1.0" encoding="utf-8"?> <!--滚动视图--> <ScrollVie ...
- android 滚动视图(ScrollView)
为了可以让内嵌布局管理器之中加入多个显示的组件,而且又保证程序不这么冗余,所以可以通过 Activity程序进行控制,向内嵌布局管理器中添加多个组件. ScrollView提供一个显示的容器,可以包含 ...
- Android 自学之滚动视图ScrollView
滚动视图ScrollView由FarmeLayout派生而出,他就是一个用于为普通组件添加垂直滚动条的组件:ScrollView里面最多包含一个组件,而ScrollView的作用就是为该组件添加一个垂 ...
- Android应用--新浪微博客户端新特性滚动视图和启动界面实现
新浪微博客户端新特性滚动视图和启动界面实现 2013年8月20日新浪微博客户端开发之启动界面实现 前言: 使用过新浪微博客户端的童鞋都清楚,客户端每一次升级之后第一次启动界面就会有新特性的介绍,用户通 ...
- 【Android】10.5 滚动视图(RecyclerView)
分类:C#.Android.VS2015: 创建日期:2016-02-19 一.简介 滚动视图(RecyclerView)的用法与布局控件的用法类似,唯一不同的是,所有布局控件中都可以包含多个组件,而 ...
- 从零開始学android<ScrollView滚动视图.十八.>
因为手机屏幕的高度有限.所以假设面对组件要显示多组信息的时候,ScrollView视图(滚动视图)能够有效的安排这些组件,浏览时能够自己主动的进行滚屏的操作. android.widget.Scrol ...
- Android零基础入门第61节:滚动视图ScrollView
原文:Android零基础入门第61节:滚动视图ScrollView 前面几期学习了ProgressBar系列组件.ViewAnimator系列组件.Picker系列组件和时间日期系列组件,接下来几期 ...
- Android中通过Java代码实现ScrollView滚动视图-以歌词滚动为例
场景 实现效果如下 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 将布局改 ...
随机推荐
- 认识WebRoot和WebContent目录
1.webRoot是不需要加的,因为它是默认的JSP目录,完整的路径应该是:项目名/xxx.jsp,如果在webroot下边建立了文件夹abc,又在abc中建立了xxx.jsp那么此时的路径应为htt ...
- VBox 安装 Ubuntu Server 的那些坑,键盘乱码、网卡互连、共享目录等
1.更新,相信大家都是有强迫症的 sudo apt-get update sudo apt-get upgrade 出现错误:Could not open lock file /var/lib/dpk ...
- Opencv图像变成灰度图像、取反图像
#include <iostream>#include <opencv2/opencv.hpp> using namespace cv;using namespace std; ...
- 246. Strobogrammatic Number 上下对称的数字
[抄题]: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at u ...
- 在Ubuntu16.04上使用rz上传文件,XXX was skipped
原本想把hadoop-2.8.5.tar.gz上传到/usr/local/src文件夹下,报错,was skipped 如下图: 换个文件夹位置,更换到本用户文件夹下,可以上传,说明是对文件夹操作权限 ...
- python-memcached模块
memcache memcache介绍 memcache概念 Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库 ...
- C#中GUID的生成格式(Guid.ToString方法 )
GUID 是微软对UUID这个标准的实现.UUID是由开放软件基金会(OSF)定义的.UUID还有其它各种实现,不止GUID一种 public string ToString( string ...
- 基于IKAnalyzer搭建分词服务
背景 前端高亮需要分词服务,nlp团队提供的分词服务需要跨域调用,而且后台数据索引使用的IK分词.综合评价,前端分词也需要基于IK分词器. IKAnalyzer服务已经停止更新,且对Lucene支持仅 ...
- do_gettimeofday使用方法
1.简介: 在Linux中可以使用函数do_gettimeofday()函数来得到精确时间.它的精度可以达到微妙,是与C标准库中gettimeofday()用发相同的函数.在Linux内核中获得时间的 ...
- 见过最好的mybatis学习网站
http://blog.csdn.net/techbirds_bao/article/details/9233599/