Android OnTouchEvent方法在ScrollView中不响应
我已经读了更多关于这方面的文章,但我还没有找到任何解决方案,对不起 我有一个带有滚动视图的.xml文件:Android OnTouchEvent方法在ScrollView中不响应,android,Android,我已经读了更多关于这方面的文章,但我还没有找到任何解决方案,对不起 我有一个带有滚动视图的.xml文件: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> </ScrollView> 如果我有scrollView,该方法将永远不会执行
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
如果我有scrollView,该方法将永远不会执行,但如果我退出scrollView,该方法将非常有效。如何使该方法与scrollView一起工作?
谢谢你的关注和帮助
public class Example extends Activity{
//I have more code
public boolean onTouchEvent(MotionEvent event) {
int x = (int) event.getX();
int y = (int) event.getY();
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
break;
}
return true;
}
}