Iphone UIScrollView-它滚动了多远?
我使用的是UIScrollView,我有一个图像,向用户表明有更多的内容可以垂直滚动。我想这个图像被隐藏时,滚动视图是在底部的所有方式。有办法做到这一点吗?我是否必须为UIScrollView创建子类并创建自己的子类?您的滚动视图的委托应该重新生成并使用它检查您的位置Iphone UIScrollView-它滚动了多远?,iphone,objective-c,uiscrollview,Iphone,Objective C,Uiscrollview,我使用的是UIScrollView,我有一个图像,向用户表明有更多的内容可以垂直滚动。我想这个图像被隐藏时,滚动视图是在底部的所有方式。有办法做到这一点吗?我是否必须为UIScrollView创建子类并创建自己的子类?您的滚动视图的委托应该重新生成并使用它检查您的位置 - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { // Get some details about the view CGSi
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
// Get some details about the view
CGSize size = [scrollView frame].size;
CGPoint offset = [scrollView contentOffset];
CGSize contentSize = [scrollView contentSize];
// Are we at the bottom?
if (-offset.y + size.height <= contentSize.height)
NSLog(@"bottom");
else
NSLog(@"not bottom");
}
-(void)ScrollViewDiEndScrollingAnimation:(UIScrollView*)scrollView{
//获取有关视图的一些详细信息
CGSize size=[scrollView框架].大小;
CGPoint offset=[scrollView内容偏移];
CGSize contentSize=[scrollView contentSize];
//我们在底部吗?
如果(-offset.y+size.height,您的滚动视图的代理应该重新扫描并使用该代理检查您的位置
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
// Get some details about the view
CGSize size = [scrollView frame].size;
CGPoint offset = [scrollView contentOffset];
CGSize contentSize = [scrollView contentSize];
// Are we at the bottom?
if (-offset.y + size.height <= contentSize.height)
NSLog(@"bottom");
else
NSLog(@"not bottom");
}
-(void)ScrollViewDiEndScrollingAnimation:(UIScrollView*)scrollView{
//获取有关视图的一些详细信息
CGSize size=[scrollView框架].大小;
CGPoint offset=[scrollView内容偏移];
CGSize contentSize=[scrollView contentSize];
//我们在底部吗?
如果(-offset.y+size.height你在iPhone上使用的是UIScrollView
,还是在iPhone上没有使用NSScrollView
?这个问题的标签需要清理一下。哎呀!对不起,我已经解决了这个问题。请注意,这可能违反了苹果的HIG。毕竟,内置的UIScrollView
不会显示拇指,除非用户是滚动。你是在iPhone上使用UIScrollView
,还是不在iPhone上使用NSScrollView
?这个问题的标签需要清理。哎哟!对不起,我已经解决了这个问题。请注意,这可能违反了苹果的HIG。毕竟,内置的UIScrollView
,除非用户滚动,否则不会显示拇指。