2
votes

I want to add something to scrollViewDidScroll. You have two possibilities:

No.1

public override void Scrolled (UIScrollView scrollView){
    this.contentOffset = TableView.ContentOffset;
}

I get this error:

Scrolled is marked as an override but no suitable method found to override.

It's clear because I have to put this into my UIScrollViewDelegate. But I'm using the default one provided by Xamarin.

No. 2

TableView.Scrolled += (object sender, EventArgs e) => {
    this.contentOffset = TableView.ContentOffset;
};

If I do this all my default delegate methods are gone. RowSelected doesn't work anymore. I only want to add this line of code, but I don't want to write my own delegate methods.

How can I easily add one line of code to detect the end of scrolling?

1

1 Answers

0
votes

If you use an UITableViewSource (which subclass UIScrollViewDelegate) then you can override both the RowSelected and Scrolled methods (on which the event is based on).