I use the following code to present an NavigationController
GridMenuViewController* vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"GridMenuViewControllerID"];
GridMenuNavigationController *nav = [[GridMenuNavigationController alloc] initWithRootViewController:vc];
vc.sheetPresentationController.prefersScrollingExpandsWhenScrolledToEdge = NO;
nav.modalPresentationStyle = UIModalPresentationPageSheet;
if (@available(iOS 16.0, *)) {
if (nav.sheetPresentationController) {
id detent = [UISheetPresentationControllerDetent customDetentWithIdentifier:UISheetPresentationControllerDetentIdentifierLarge resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> _Nonnull context) {
return [[UIScreen mainScreen] bounds].size.height * 0.6;
}];
nav.sheetPresentationController.detents = @[detent];
nav.sheetPresentationController.prefersGrabberVisible = YES;
}
}
nav.sheetPresentationController.prefersScrollingExpandsWhenScrolledToEdge = NO;
[self presentViewController:nav animated:YES completion:nil];
I woluld like to disable the bounces when scroll up the present view, how can I do that?
Support video https://www.youtube.com/watch?v=P53ZPxzdWCU
I tried so many code like
if (@available(iOS 11.0, *)) {
self.collectionView.contentInsetAdjustmentBehavior = 2;
} else {
self.collectionView.automaticallyAdjustsScrollIndicatorInsets = NO;
}
self.collectionView.verticalScrollIndicatorInsets = UIEdgeInsetsMake(0, 0, self.view.safeAreaInsets.bottom, 0);
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
[scrollView setContentOffset: CGPointMake(scrollView.contentOffset.x, 0)];
}
I expecting there no any bounces behavior when scroll up.