Detecting Scroll In A Nested UITableView

JSpringJSpring GBUniversity ✭✭


This stems from

I have a UITableView within a UIView, the tables source is set to a child class of UITableViewSource which seems to inherit from UIScrollViewDelegate. However overriding Scrolled and putting in a private func with an export for scrollViewDidScroll: still does not fire the event when the user scrolls the table view.

I was wondering if anyone else has come across this issue. My code for the scrollViews are as follows:

    #region Underlying Scroll View Related
    private void ScrollViewDidScroll (UIScrollView scrollView)
        var currentOffset = scrollView.ContentOffset.Y;
        var maxOffset = scrollView.ContentSize.Height - scrollView.Frame.Size.Height;

        float bottomPadding = 10.0f; // This should be equal to the cell height. Then can set to x amt of cells early
        if(maxOffset - currentOffset <= bottomPadding)
            Console.WriteLine ("At Bottom Of The Scroll View / Table");
            if(tv != null)
                launchReload (tv, null);

    public override void Scrolled (UIScrollView scrollView)
        ScrollViewDidScroll (scrollView);


  • MarkSmith.8123MarkSmith.8123 USXamarin Team, University, XamUProfessors Xamurai

    Hi @JSpring --

    I'm not sure why Scrolled isn't working for you. I'm seeing it just fine -- here's a sample which outputs the current scrolled position into the debug console as you scroll the UITableView:

    Try running this, scroll the contents and watch the output window. I didn't do anything tricky -- just put a UITableView into the UI, set a UITableViewSource and overrode the methods. Is that what you are doing as well?

    Good luck!
    Mark Smith
    Xamarin University | Curriculum

  • JSpringJSpring GBUniversity ✭✭

    Got it working eventually by putting an Export in - will have a look into this further once we get the next release out and I can play around.


Sign In or Register to comment.