android中View的scrollBy(int x,int y)和scrollTo(int x,int y)的区别
来源:互联网 发布:行知职业技术学校地址 编辑:程序博客网 时间:2024/04/28 03:20
先看看Google的官方文档的解释
public void scrollBy (int x, int y)
Added in API level 1
Move the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int)
and the view will be invalidated.
Parameters
public void scrollTo (int x, int y)
Added in API level 1
Set the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int)
and the view will be invalidated.
Parameters
解释:
scrollBy(int x,int y)意思就是将view移动x和y那么远的距离;而scrollTo(int x, int y)意思就是将view移动到(x,y)坐标的位置上去。以下是scrollBy(int x,int y)的源码
public void scrollBy(int x, int y) { scrollTo(mScrollX + x, mScrollY + y); }意思就显而易见了。
0 2
- android中View的scrollBy(int x,int y)和scrollTo(int x,int y)的区别
- 滑动中scrollTo(int x,int y);和scrollBy(int x,int y)的区别(经典)
- Scoller,scrollTo(int x, int y),scrollBy(int x, int y)的区别
- View.scrollTo(int x, int y)与View.scrollBy(int x, int y)
- android view.scrollTo(int x,int y)注意事项
- Android scrollBy(x,y)和scrollTo(x,y)的区别
- int *x, y; int* x, y;
- int x/*test*/y;的结果是?
- 参数的引用传递 swap(int &x,int &y)
- String的indexOf(),lastIndexOf(),substring(int x),substring(int x , int y)方法 StringBuffer
- y=x++ + ++x(int x=0)的结果?
- const int *x 和 int * const x, const int& x和 int const &x的区别
- 在滑对于ScrollBy(int x, int y)与scroller.startscroll(int startx,int starty, int dx, int dy, int duration)
- 如何产生一个从x到y的k个随机数 Random(int x,int y ,int k)
- J2ME中Graphics 的translate(int x, int y) 函数的使用
- ScrollTo(x,y)和ScrollBy(x,y)
- CDC::TextOut(int x, int y, LPCTSTR lpszString, int nCount
- create function GetMax(@x int,@y int) returns int
- Oracle 中的JOIN
- Postgresql
- HTML5-桌面式web应用-与web服务器通信( XHR, 服务器发送事件, Web Socket:)
- ACM--steps--dyx--2.3.8--小兔的棋盘
- ASN.1语法及其公钥的理解
- android中View的scrollBy(int x,int y)和scrollTo(int x,int y)的区别
- 去掉数组中的指定的元素
- oracle中exp,imp的使用详解
- C++标准库bitset
- 服务器禁止多个ip来提供代理服务,
- 停止Hadoop或HBase集群的脚本
- Socket客户端
- 多台电脑操作同一个电脑的Oracle数据库步骤
- 引用不是变量,引用只是引用