Using onInterceptTouchEvent

后端 未结 1 1543
说谎
说谎 2021-01-15 07:43

In my code, I use a predetermined XML layout to generate the Views in my Activity. I don\'t create them programmatically, therefore I can\'t find a way to override the onInt

1条回答
  •  失恋的感觉
    2021-01-15 08:44

    Extend the class you are interested in:

    package com.myapp;
    
    public class MyLayout extends RelativeLayout { 
    
        // Don't forget to include all the super constructors...
    
        public void onInterceptTouchEvent(...){}
    
    }
    

    Then, you can use that class in xml like this:

    
    
        
    
    
    

    0 讨论(0)
提交回复
热议问题