問題描述
我將 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:單擊將其滾動到頂部的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!