zoukankan      html  css  js  c++  java
  • Touch事件传递的实验

    通过自定义的Relayout   LinearLayout   TextView ,

    布局为:
     
     
    分别打印事件方法:
    1.当所有的都是super的时候,点击TextView的时候,事件的传递是:
    此时,我再TextView上随意的滑动,是没有任何的事件过程的。
       2)如果我在TextView的OntouchEvent中返回true,则事件传递:
            
               一直的做循环。
     3)如果我在TextView的OntouchEvent中返回false,则事件传递:
        结果跟1.1是一样的
       4)如果我在TextView的dispatchtouchevent中返回true,ontouchevent中返回super  则事件传递:
        
        5)如果我在TextView的dispatchtouchevent中返回false,ontouchevent中返回super  则事件传递:
                
      根本就不会进入onTouchEvent事件
     
     
     
    2. 当点击LinearLayout的时候  事件的传递:
       2)如果我在LinearLayout的dispatchTouchEvent中返回true,则事件传递:
            
                3)如果我在LinearLayout的dispatchTouchEvent中返回false,则事件传递:        
                    
                4) 如果我在LinearLayout的dispatchTouchEvent中返回super   onintercepttouchevent返回true,则事件传递:
                    
           4) 如果我在LinearLayout的dispatchTouchEvent中返回super   onintercepttouchevent返回false,则事件传递:
             
             5) 如果我在LinearLayout的dispatchTouchEvent中返回super   onintercepttouchevent返回super,  TouchEvent  返回true则事件传递:
                
     
     
     
     





  • 相关阅读:
    python的进程与线程
    推荐一个GOLANG入门很好的网址
    为什么Python 3.6以后字典有序并且效率更高?
    git实用指南
    常用正则总结
    简单小结密码学入门知识点
    什么是k8s
    win10下apache superset的使用
    Maven工作记录
    JDK下载地址和安装
  • 原文地址:https://www.cnblogs.com/flyme2012/p/4047032.html
Copyright © 2011-2022 走看看