使用和不使用navigationbar分别处理显示和返回页面

不使用navigationbar的情况下

AnnounceViewController *pushView = [[AnnounceViewController alloc]init];
pushView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:pushView animated:YES completion:nil];

 

- (void)goback_button_clicked
{
    //    [self dismissModalViewControllerAnimated:YES];  //描述:通过事件进行返回。
    
    [self dismissViewControllerAnimated:YES completion:^{
        
        NSLog(@"back");
    }];
}

使用navigationbar的情况下

AnnounceViewController *pushView = [[AnnounceViewController alloc] init];
[self.navigationController pushViewController:pushView animated:YES];
[pushView release];

- (void)backToPrevious
{
    [self.navigationController popViewControllerAnimated:YES];
}

 

 

你可能感兴趣的:(NavigationBar)