2012-02-16 93 views

回答

0

我没有使用CCScrollView,但我已经尝试过另一个UIScrollView实现cocos2d,我想我解决这个问题的方式也适用。将您的滚动视图的contentOffset设置为ccp(0.0, scrollview.contentSize.height - scrollview.size.height)而不是ccp(0.0, 0.0)。然后,根据您的滚动视图的contentSize调整内容的位置。例如,如果你想你的内容的是ccp(x, y)位置,因为它的出现,你可以不喜欢

content.position = CGPointMake(x, scrollview.contentSize.height - scrollview.size.height + y)

大小滚动视图的视图大小,但我不知道什么实际的属性了滚动因为我没有用过它。下面的代码

+0

感谢。我已经解决了这个问题' - [CCScrollView relocateContainer:]'。我想修改库并不好,但我认为这是唯一的方法。 – 2012-02-20 12:23:17

0

使用的作品对我来说:

[self.scrollView setContentOffset:ccp(0, -self.scrollView.container.contentSize.height + self.scrollView.boundingBox.size.height) animated:NO];