UIScrollView: single tap scrolls it to top(UIScrollView:单击将其滚动到顶部)
问题描述
我将 pagingEnabled 设置为 YES 的 UIScrollView,并以编程方式将其内容滚动到底部:
I have the UIScrollView with pagingEnabled set to YES, and programmatically scroll its content to bottom:
CGPoint contentOffset = scrollView.contentOffset;
contentOffset.y = scrollView.contentSize.height - scrollView.frame.size.height;
[scrollView setContentOffset:contentOffset animated:YES];
它滚动成功,但在那之后,单击它的内容会向上滚动以抵消它在向下滚动之前的偏移量.仅当我以编程方式将 scrollView 的内容滚动到底部然后点击时才会发生这种情况.当我滚动到任何其他偏移量然后点击时,什么都没有发生.
it scrolls successfully, but after that, on single tap its content scrolls up to offset that it has just before it scrolls down. That happens only when I programmaticaly scroll scrollView's content to bottom and then tap. When I scroll to any other offset and then tap, nothing is happened.
这绝对不是我想要的.应该如何解决?
That's definitely not what I'd like to get. How that should be fixed?
提前非常感谢!
帖木儿.
推荐答案
这似乎是一个错误:
UIScrollView 不记得位置
我已在 iOS 4.2(模拟器)上对此进行了测试,但问题仍然存在.
I have tested this on iOS 4.2 (Simulator) and the issue remains.
这篇关于UIScrollView:单击将其滚动到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UIScrollView:单击将其滚动到顶部


- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01