It looks like you're new here. If you want to get involved, click one of these buttons!
#import \"FlipViewViewController.h\"
@interface FlipViewViewController ()
@end
@implementation FlipViewViewController
@synthesize yellowView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[self setYellowView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)gotoYellow:(id)sender {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view] cache:YES];
yellowView.frame = [self view].bounds;
[[self view] addSubview:yellowView];
[UIView commitAnimations];
}
- (IBAction)gotoWhite:(id)sender {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[self view] cache:YES];
[yellowView removeFromSuperview];
[UIView commitAnimations];
}
@end
#import <UIKit/UIKit.h>
@interface FlipViewViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIView *yellowView;
- (IBAction)gotoYellow:(id)sender;
- (IBAction)gotoWhite:(id)sender;
@end
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeWhat do you mean that you found a solution but can't find the right one? What works, and what doesn't?
I would think you should be adding a new view and removing the old one in each of your button actions.
Duncan C
WareTo
Check out our apps in the Apple App store
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome