我在一个RelativeLayout中动态的添加了很多TextViews。我现在面临的问题是:
不论什么时候当我单独申请一个 onTouch 监听器到TextViews,当我添加touch事件到relative layout时它能检测到touch 事件,但是没有回应。
检测touch事件代码:
但是我在 myRelativeLayout 添加所有的 TextViewsmyRelativeLayout.setOnTouchListener(cellTouch);
现在 onTouchListener 也不能调用,为什么?
在 myRelativeLayout.xml 添加:
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"