开发者

Tab Bar Controller- switch UIView within one tab

ok here is my applications setup: Two xib's

MainWindow.xib NewsletterView.xib

Set up as follows: MainWindow.xib Files owner First Responder The Delegate Window Tab Bar Controller--setup to load tabs from .xib's Two tabs -Newsletter -Map

I'm not concerned about the Map tab.

Within the NewsletterView.xib ( i do have the .h and .m files setup)

Files owner set up with class 开发者_JS百科NewsletterViewController via interface builder.

First Responder

and Two views:

View- setup as NewsSignUpView via IBOutlet - this is the first view that loads on the selected tab.

View - setup as NewsReaderView via IBOutlet

I want to be able to click a button (assigned via IBAction) on NewsSignUpView the flip horizontally to reveal NewsReaderView.

This is what i have so far:

-(IBAction) revealNewsReaderView 
{CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:newsSignUpView cache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];  
[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView commitAnimations];
}

This Flips the view but doesn't change the view shown.

Can anyone provide some code, or point out where im going wrong?

Thanks in advance.


You can download the apple's sample to see implementation of flipping between two views in same frame. http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜