Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的项目中,我有滚动视图。当我拖动图像时,它会在滚动视图中添加一些内容。同样,我可以通过希望添加多次。当滚动视图的内容增加时,它将更新内容大小。
但我希望滚动视图将焦点放在滚动中最后添加的内容。怎么做?请帮我一些代码。
请更清楚,您希望能够滚动到最后添加的元素吗?如果是这样的话,
CGPoint bottomOffset = CGPointMake(0, scrollView.contentSize.height - scrollView.bounds.size.height); [scrollView setContentOffset:bottomOffset animated:YES];