public void ScrollToTop() { if (ReportsTableView == null) { return; } var point = new CGPoint(0, -ReportsTableView.ContentInset.Top); ReportsTableView.SetContentOffset(point, true); }
private void onReportsTableScrolled(object sender, CGPoint offset) { if (CalendarIsVisible) { var topConstant = (TopCalendarConstraint.Constant + offset.Y).Clamp(0, calendarHeight); TopCalendarConstraint.Constant = topConstant; if (topConstant == 0) { return; } // we need to adjust the offset of the scroll view so that it doesn't fold // under the calendar while scrolling up var adjustedOffset = new CGPoint(offset.X, ReportsTableView.ContentOffset.Y - offset.Y); ReportsTableView.SetContentOffset(adjustedOffset, false); View.LayoutIfNeeded(); if (topConstant == calendarHeight) { HideCalendar(); } } }
public void ScrollToTop() { var point = new CGPoint(0, -ReportsTableView.ContentInset.Top); ReportsTableView.SetContentOffset(point, true); }