问题描述
- 为什么我执行此方法是五响应
-
rlbttom.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
int y=(int)event.getY();
Log.i("info", "+y"+y);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
toprl.getHeight()-y);
Log.i("info", "+y"+y);
toprl.setLayoutParams(lp2);
break;
case MotionEvent.ACTION_UP:break; } return false; }
解决方案
http://blog.sina.com.cn/s/blog_4e1e357d0101eacs.html
解决方案二:
没有触发事件的条件,
解决方案三:
先判断是否进入该监听方法
时间: 2024-10-01 22:20:48