Android事件传递机制【Touch事件】
16lz
2021-01-23
Android中提供了ViewGroup、View、Activity三个等级的Touch事件处理。也就是说,这三个地方都有事件回调方法。
测试DEMO视图结构: <com .orgcent.eventtest.EventLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#032d3d" android:orientation="vertical" > <com .orgcent.eventtest.EventTextView android:id="@+id/tvEvent" android:layout_width="fill_parent" android:layout_height="100dp" android:gravity="center" android:textColor="@android:color/black" android:background="@android:color/white" android:text="Activity - ViewGroup - View Event http://orgcent.com dispatch Test"/> </com> 至于三者之间的执行顺序,将在下面详细阐述:
原文地址: Android事件传递机制【Touch事件】|http://orgcent.com/android-touch-event-mechanism/
测试DEMO视图结构: <com .orgcent.eventtest.EventLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#032d3d" android:orientation="vertical" > <com .orgcent.eventtest.EventTextView android:id="@+id/tvEvent" android:layout_width="fill_parent" android:layout_height="100dp" android:gravity="center" android:textColor="@android:color/black" android:background="@android:color/white" android:text="Activity - ViewGroup - View Event http://orgcent.com dispatch Test"/> </com> 至于三者之间的执行顺序,将在下面详细阐述:
原文地址: Android事件传递机制【Touch事件】|http://orgcent.com/android-touch-event-mechanism/
更多相关文章
- android中返回键事件
- Android为按钮添加相应事件的代码
- Android学习07-----事件处理(4)键盘事件和触摸事件
- Android——按钮的事件监听
- Android 给自己的类加个事件
- Android Touch事件传递机制具体解释 上
- android 事件处理(三)