我有一个控件,单手指滑动它时不做处理,双手指同时向上滑动时触发一个事件(如弹出一个对话框),这个事件该怎么写?解大虾附上代码。
解决方案 »
- 获取图片坐标
- 怎么给listview的每一项添加事件监听器
- 求分析这算是bug吗?
- 求助GridView里显示ImageView的问题!
- Android怎么连接Web服务器 ?
- 为什么我的android源码编译出来,没有system.img,只有data.img和ramdisk.img
- android开发中Caused by: java.lang.NullPointerException
- 短信监听程序,收到短信就报错
- no path or pathfile specified on the command line
- 我使用MaterialDialog,想把width改小一点,怎么改?
- android 地图定位问题
- 使用google map时申请api Key,得翻墙了么?急急急!
if (event != null) {
int pc = event.getPointerCount();
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) { } else if (action == MotionEvent.ACTION_MOVE) {
if (pc == 2) {
}
} else if (action == MotionEvent.ACTION_POINTER_2_DOWN) {
} else if (action == MotionEvent.ACTION_POINTER_2_UP) {
} else if (action == MotionEvent.ACTION_UP) {
}
}
return true;
}根据加入自己的逻辑代码,可以根据滑动的时间,距离。