我正在制作一个有很多ImageView
s的应用程序,我需要在其中一些程序中添加一个触控侦听器。在这样做时,我遇到了一个问题。如果指针被固定在ImageView
附近触摸侦听器并且即将产生滚动事件的位置,则View
和{{1}之间似乎存在战斗场景在事件实际发生的w / c中,事件应该属于w / c。 屏幕以快速滚动然后返回第一个指针被触及的位置,这意味着它是一个不受欢迎的行为。
在ScrollView
中设置onTouchListener
会使滚动感到不安和不受欢迎,如何在滚动时阻止ImageView
接收触摸事件?
布局: act_map_view.xml
ImageView
备注:
<?xml version="1.0" encoding="utf-8"?>
<com.nkraft.mobiletomblocator.CustomVScroll
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" >
<com.nkraft.mobiletomblocator.CustomHScroll
android:id="@+id/hScroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none" >
<com.nkraft.mobiletomblocator.CustomGridLayout
android:id="@+id/map_grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.nkraft.mobiletomblocator.CustomGridLayout>
</com.nkraft.mobiletomblocator.CustomHScroll>
</com.nkraft.mobiletomblocator.CustomVScroll>
在运行时填充GridLayout
。ImageView
,以便我可以同时向两个方向滚动,即对角线滚动