在这里,我为您提供示例代码。我只是为两个视图编写代码。您只需要根据滚动确定视图位置即可。
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
if(scroll.contentOffset.y> 480 && scroll.contentOffset.x<320)
{
//where next view is you view which you need to display according your requirements.
next *pushnext = [[next alloc]initWithNibName:@"next" bundle:nil];
[self.view addSubview:pushnext.view];
CGRect frame = pushnext.view.frame;
frame.origin.x = 10;
pushnext.view.frame = frame;
[pushnext release];
}
else if(scroll.contentOffset.y<480 && scroll.contentOffset.x>320)
{
//where next view is you view which you need to display according your requirements.
next *pushnext = [[next alloc]initWithNibName:@"next" bundle:nil];
[self.view addSubview:pushnext.view];
CGRect frame = pushnext.view.frame;
frame.origin.x = 10;
pushnext.view.frame = frame;
[pushnext release];
}
}
我希望这能帮到您。