我试图弄清楚当状态栏被触摸时如何滚动到 UIScrollView 的底部。我熟悉 UIScrollView 中的 @property(nonatomic) BOOL scrollsToTop 方法,但这不是我要找的。
我这里也有这个方法,当 View 加载时自动滚动到底部。有什么想法吗?
-(void)scrollToBottom{
CGPoint bottomOffset = CGPointMake(0, scroller.contentSize.height - scroller.bounds.size.height);
[scroller setContentOffset:bottomOffset animated:YES];
}
最佳答案
类似于How to detect touches in status bar .这里建议在状态栏上使用透明的 UIView 并检测触摸。
关于ios - UIScrollView 触摸状态栏时滚动到底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14386476/