---
title: "触屏事件的获取和触摸屏幕位置"
author: "hibernater"
date: "2010-06-09T17:07:17Z"
tags: ["ASP", "UP"]
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2010-06-09T17:07:17Z"
id: 688192
url: "https://hibernater.iteye.com/blog/688192"
---

public boolean onTouchEvent(MotionEvent event) {

//获得触摸的坐标  
float x = event.getX();  
float y = event.getY(); switch (event.getAction())  
{  
//触摸屏幕时刻  
case MotionEvent.ACTION\_DOWN:

break;  
//触摸并移动时刻  
case MotionEvent.ACTION\_MOVE:

break;  
//终止触摸时刻  
case MotionEvent.ACTION\_UP:  
break;  
}  
return true;  
}

 

引用：[http://sean.huanglijiang.com/article.asp?id=80](http://sean.huanglijiang.com/article.asp?id=80)