Most visited

Recently visited

Added in API level 1

Touch

public class Touch
extends Object

java.lang.Object
   ↳ android.text.method.Touch


Summary

Public methods

static int getInitialScrollX(TextView widget, Spannable buffer)
static int getInitialScrollY(TextView widget, Spannable buffer)
static boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event)

处理拖动的触摸事件。

static void scrollTo(TextView widget, Layout layout, int x, int y)

将指定的小部件滚动到指定的坐标,只是将X滚动位置限制为滚动到指定的Y位置后可见的文本的水平区域。

Inherited methods

From class java.lang.Object

Public methods

getInitialScrollX

Added in API level 3
int getInitialScrollX (TextView widget, 
                Spannable buffer)

Parameters
widget TextView: The text view.
buffer Spannable: The text buffer.
Returns
int

getInitialScrollY

Added in API level 3
int getInitialScrollY (TextView widget, 
                Spannable buffer)

Parameters
widget TextView: The text view.
buffer Spannable: The text buffer.
Returns
int

onTouchEvent

Added in API level 1
boolean onTouchEvent (TextView widget, 
                Spannable buffer, 
                MotionEvent event)

处理拖动的触摸事件。 您也可以执行其他操作,例如触摸移动光标。

Parameters
widget TextView
buffer Spannable
event MotionEvent
Returns
boolean

scrollTo

Added in API level 1
void scrollTo (TextView widget, 
                Layout layout, 
                int x, 
                int y)

将指定的小部件滚动到指定的坐标,只是将X滚动位置限制为滚动到指定的Y位置后可见的文本的水平区域。

Parameters
widget TextView
layout Layout
x int
y int

Hooray!