私は左からフリップのようなアニメーションでView Controllersビューを追加しているiPhoneアプリケーションを持っています.Navigationbarbuttonアイテムでそれを行っていました.それをクリックすると、View Controllersビューをルートビューに追加していました。そのアクションは、そのビューを削除し、そのような前のボタンを追加しています.しかし、pbmは、そのビュー内のボタンアクションでその情報ビューを削除する必要があります.ここに、フリップアニメーションのコードがあります.`
- (void)backPressed1
{
InfoViewController *infoviewcontroller = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.95];
//[UIView beginAnimations:nil context:NULL];
//[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
//CGRect frame=CGRectMake(0,0,320,480);
[rootview removeFromSuperview];
//[infoviewcontroller.view setFrame:frame];
//selfhelpscoresAppDelegate *appdelegate=[[UIApplication sharedApplication] delegate];
[infoviewcontroller viewWillAppear:YES];
[self.view addSubview:infoviewcontroller.view];
[UIView commitAnimations];
UIImage *buttonImage = [UIImage imageNamed:@"information_btn.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:buttonImage forState:UIControlStateNormal];
button.frame = CGRectMake(0, 0, 42, 32);
[button addTarget:self action:@selector(backpressed) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = customBarItem;
//UILabel *label =[[[UILabel alloc]init]autorelease];
self.navigationItem.title=@"Tutorial";
//label.text = @"";
//self.navigationController.title = @"";
[customBarItem release];
}
-(IBAction)backpressed
{
InfoViewController *infoviewcontroller = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.95];
//[UIView beginAnimations:nil context:NULL];
//DailypercentageViewController *pieChart = [[DailypercentageViewController alloc] initWithNibName:@"DailypercentageViewController" bundle:nil];
//[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
//CGRect frame=CGRectMake(0,0,320,370);
[infoviewcontroller.view removeFromSuperview];
[self.view addSubview:rootview];
[UIView commitAnimations];
//[rearView setFrame:frame];
//[pieChart viewDidAppear:YES];
UIImage *buttonImage1 = [UIImage imageNamed:@"information_btn.png"];
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 setImage:buttonImage1 forState:UIControlStateNormal];
button1.frame = CGRectMake(0, 0, 42, 32);
[button1 addTarget:self action:@selector(backPressed1) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *customBarItem1 = [[UIBarButtonItem alloc] initWithCustomView:button1];
self.navigationItem.rightBarButtonItem = customBarItem1;
[customBarItem1 release];
//UILabel *label1 =[[[UILabel alloc]init]autorelease];
self.navigationItem.title=@"";
//label1.text = @"Home";
//self.title= @"Home";
}
`私の問題は、このインフォビューを削除して、インフォビューのボタンアクションでルートビューに戻る方法です?