雾山的Robotium学习笔记---scroll

2024-04-25 01:48

本文主要是介绍雾山的Robotium学习笔记---scroll,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

上下滚动

scrollDown
public boolean scrollDown()
Scrolls down the screen.
Returns:
true if more scrolling can be performed 
false if it is at the end of the screen

滚动条进行向下操作
返回:
true-如果可以进行滚动的话
false-如果已经滚动到底部,无法滚动


scrollUp

public boolean scrollUp()
Scrolls up the screen.
Returns:
true if more scrolling can be performed
false if it is at the top of the screen
滚动条进行向上操作

返回:
true-如果可以进行滚动的话
false-如果已经滚动到顶部,无法滚动



scrollToBottom

public void scrollToBottom()
Scrolls to the bottom of the screen.
向下滚动屏幕,一直滚动到底部


scrollToTop

public void scrollToTop()
Scrolls to the top of the screen.
向上滚动屏幕,一直滚动到顶部



对列表

scrollDownList

public boolean scrollDownList(android.widget.AbsListView list| int index)
Scrolls down the specified AbsListView.
Parameters:
list - the AbsListView to scroll
index - the index of the ListView to scroll. 0 if only one list is available
Returns:
true if more scrolling can be performed
操作一个list向下滚动

参数:
list-被操作的滚动条的对象
index-被操作的滚动条索引,如果是0,表示只有一个可以滚动的list
返回:
true-如果可以进行滚动的话
false-如果已经滚动到底部,无法滚动


scrollUpList

public boolean scrollUpList (android.widget.AbsListView list | int index)
Scrolls up a ListView matching the specified index.
Parameters:
list - the AbsListView to scroll
index - the index of the ListView to scroll. 0 if only one list is available
Returns:
true if more scrolling can be performed
操作一个list向上滚动

参数:
list-被操作的滚动条的对象
index-被操作的滚动条索引,如果是0,表示只有一个可以滚动的list
返回:
true-如果可以进行滚动的话
false-如果已经滚动到顶部,无法滚动


scrollListToBottom

public boolean scrollListToBottom (android.widget.AbsListView list | int index)
Scrolls to the bottom of the specified AbsListView.
Parameters:
list - the AbsListView to scroll
index - the index of the ListView to scroll. 0 if only one list is available
Returns:
true if more scrolling can be performed

操作一个list向下滚动一直滚动到底部
参数:
list-被操作的滚动条的对象
index-被操作的滚动条索引,如果是0,表示只有一个可以滚动的list
返回:
true-如果可以进行滚动的话
false-如果已经滚动到底部,无法滚动


scrollListToTop

public boolean scrollListToTop (android.widget.AbsListView list | int index) 
Scrolls to the top of the specified AbsListView.
Parameters:
list - the AbsListView to scroll
index - the index of the ListView to scroll. 0 if only one list is available
Returns:
true if more scrolling can be performed

操作一个list向上滚动一直滚动到顶部
参数:
list-被操作的滚动条名称
index-被操作的滚动条索引,如果是0,表示只有一个可以滚动的list
返回:
true-如果可以进行滚动的话
false-如果已经滚动到顶部,无法滚动


scrollListToLine

public void scrollListToLine (android.widget.AbsListView list | int index , int line)
Scroll the specified AbsListView to the specified line.
Parameters:
absListView - the AbsListView to scroll
index - the index of the AbsListView to scroll
line - the line to scroll to
操作滚动条滚动到list的某一行

参数:
list-被操作的滚动条名称
index-被操作的滚动条索引
line-滚动到第几行



水平滚动

scrollToSide

scrollToSide
void scrollToSide (int side [, float scrollPosition])
Scrolls horizontally.
Parameters:
side - the side to scroll; RIGHT or LEFT
scrollPosition - the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60.

水平滚动屏幕,可限制操作滚动的位置
参数:
side-水平滚动的方向,LEFT或者RIGHT
scrollPosition-滚动屏幕的比例,从0到1,如果是0.5,则只会对一半的屏幕进行滚动


scrollViewToSide

public scrollViewToSide (android.view.View.view view, int side [, float scrollPosition])
Scrolls a View horizontally.
Parameters:
view - the View to scroll
side - the side to scroll; RIGHT or LEFT
scrollPosition - the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60.
水平滚动某一个view,可限制操作滚动的位置

参数:
view-滚动的view的对象
side-水平滚动的方向,LEFT或者RIGHT
scrollPosition-滚动屏幕的比例,从0到1,如果是0.5,则只会对一半的屏幕进行滚动


点我查看API


这篇关于雾山的Robotium学习笔记---scroll的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/933411

相关文章

Unity新手入门学习殿堂级知识详细讲解(图文)

《Unity新手入门学习殿堂级知识详细讲解(图文)》Unity是一款跨平台游戏引擎,支持2D/3D及VR/AR开发,核心功能模块包括图形、音频、物理等,通过可视化编辑器与脚本扩展实现开发,项目结构含A... 目录入门概述什么是 UnityUnity引擎基础认知编辑器核心操作Unity 编辑器项目模式分类工程

Python学习笔记之getattr和hasattr用法示例详解

《Python学习笔记之getattr和hasattr用法示例详解》在Python中,hasattr()、getattr()和setattr()是一组内置函数,用于对对象的属性进行操作和查询,这篇文章... 目录1.getattr用法详解1.1 基本作用1.2 示例1.3 原理2.hasattr用法详解2.

Go学习记录之runtime包深入解析

《Go学习记录之runtime包深入解析》Go语言runtime包管理运行时环境,涵盖goroutine调度、内存分配、垃圾回收、类型信息等核心功能,:本文主要介绍Go学习记录之runtime包的... 目录前言:一、runtime包内容学习1、作用:① Goroutine和并发控制:② 垃圾回收:③ 栈和

Android学习总结之Java和kotlin区别超详细分析

《Android学习总结之Java和kotlin区别超详细分析》Java和Kotlin都是用于Android开发的编程语言,它们各自具有独特的特点和优势,:本文主要介绍Android学习总结之Ja... 目录一、空安全机制真题 1:Kotlin 如何解决 Java 的 NullPointerExceptio

重新对Java的类加载器的学习方式

《重新对Java的类加载器的学习方式》:本文主要介绍重新对Java的类加载器的学习方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、介绍1.1、简介1.2、符号引用和直接引用1、符号引用2、直接引用3、符号转直接的过程2、加载流程3、类加载的分类3.1、显示

Java学习手册之Filter和Listener使用方法

《Java学习手册之Filter和Listener使用方法》:本文主要介绍Java学习手册之Filter和Listener使用方法的相关资料,Filter是一种拦截器,可以在请求到达Servl... 目录一、Filter(过滤器)1. Filter 的工作原理2. Filter 的配置与使用二、Listen

利用Python快速搭建Markdown笔记发布系统

《利用Python快速搭建Markdown笔记发布系统》这篇文章主要为大家详细介绍了使用Python生态的成熟工具,在30分钟内搭建一个支持Markdown渲染、分类标签、全文搜索的私有化知识发布系统... 目录引言:为什么要自建知识博客一、技术选型:极简主义开发栈二、系统架构设计三、核心代码实现(分步解析

Java进阶学习之如何开启远程调式

《Java进阶学习之如何开启远程调式》Java开发中的远程调试是一项至关重要的技能,特别是在处理生产环境的问题或者协作开发时,:本文主要介绍Java进阶学习之如何开启远程调式的相关资料,需要的朋友... 目录概述Java远程调试的开启与底层原理开启Java远程调试底层原理JVM参数总结&nbsMbKKXJx

Java深度学习库DJL实现Python的NumPy方式

《Java深度学习库DJL实现Python的NumPy方式》本文介绍了DJL库的背景和基本功能,包括NDArray的创建、数学运算、数据获取和设置等,同时,还展示了如何使用NDArray进行数据预处理... 目录1 NDArray 的背景介绍1.1 架构2 JavaDJL使用2.1 安装DJL2.2 基本操

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert