开发者

iPhone SDK page flip and Page curl

I got the page flips and curls to work. I'll describe what happens...

I build开发者_JAVA技巧 and Go

The App opens in simulator

I press a button and the page curls to page 2... but when it gets to page 2 the page drops down a bit. Why does this happen?


if you're using view controllers, you shouldn't be adding their views manually, but should be using -[UINavigationController pushViewController:animated:]. There are ways to use these two techniques together, but that might be more trouble than it's worth. I'd suggest not using a viewController for your second, curled in view, until you're a bit more comfortable with the UIXXXController design pattern. Just add an outlet in your primary viewController for the paged-in view and hook it up in IB.


- (IBAction)goToSecondView {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view]cache:YES];
    [self.view addSubview:secondViewController.view];
    [UIView commitAnimations];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜