Forum Xamarin.Android

Touch Event on a TableLayout

fbs419fbs419 USMember ✭✭

In my .axml I have a TableLayout inside a ScrollView inside a RelativeLayout:

        <RelativeLayout xmlns:android=""
            <ScrollView xmlns:android=""
                <MyCustomTableLayout  xmlns:android=""

I want to do something if the user hits the whole table, not individual cells. I create MyCustomTableLayout which inherits from TableLayout and which overrides both OnTouchEvent and OnInterceptTouchEvent. I access it by:

MyCustomTableLayout myTL = FindViewById<MyCustomTableLayout> (Resource.Id.MyId);

The constructor for the class gets called, but no matter where I touch, OnTouchEvent and OnInterceptTouchEvent never get called. What else do I have to do to get these methods called?



  • fbs419fbs419 USMember ✭✭

    Well -- by doing myTL.OnInterceptTouchEvent(e), the methods get called, but only if a cell in the table is selected. [ e is just declared as a local MotionEvent.] What I want is to be to click anywhere in the TableLayout and have the method get called. Anybody have any ideas?

Sign In or Register to comment.