Question

This seems like it should be pretty straight forward but im really stuck. I basically want to start the app and it goes to the center view, where the user can swipe up down left or right to access four different views. the picture pretty much sums it up. I will make the text in the picture "swipe up for view 1" "swipe down for ....." buttons also that achieve the same thing as the swiping but I dont want to ask for too much so if anyone can help me out and show me how to program what Im looking for I would much appreciate it.Main Menu views Of app

I was able to get it to be just one massive view but I realized that I want it to jump to every different view, not scroll and be half way there. and when I tried to make cgrect frames it was very confusing to keep it all in order.

Was it helpful?

Solution

Here,I am Providing you sample code.I just write code for two views.You just need to determine the views position according to scroll.

-(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];
}

}

I hope this will help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top