x1 為 down
x2 為 up
x 上的值始終無法正確獲取,無論怎么撥,x1 都是大于 x2
```
I/System.out: -313.0=len(x2-x1), [x1=545.0, x2=232.0, y1=634.0, y2=523.0]
I/System.out: -400.0=len(x2-x1), [x1=545.0, x2=145.0, y1=634.0, y2=469.0]
I/System.out: -88.0=len(x2-x1), [x1=449.0, x2=361.0, y1=525.0, y2=540.0]
I/System.out: -226.0=len(x2-x1), [x1=449.0, x2=223.0, y1=525.0, y2=459.0]
```
如果NestedScrollView沒有滾動(即內容很少,沒達到需要滾動的條件)時, onTouchListener則取值正常。
這是為什么呢?
uj5u.com熱心網友回復:
問題已解決,原來我在前面給其它xml元素加了個 onLongClickListener(//然后里面回傳 true 值)這樣都行!! 不同元素之間也會影響,,,真是深坑 。。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/254998.html
標籤:Android
