我正在使用故事板和IOS6。我想回到以前的viewcontroller,但它不工作。dismissViewControllerAnimated不工作
我在這裏定製了我的後扣。
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
btnBack.frame = CGRectMake(0, 0, 45,35);
[btnBack setTitle:@"Back" forState:UIControlStateNormal];
[btnBack.titleLabel setFont: [UIFont fontWithName:@"Courier" size:15]];
btnBack.layer.cornerRadius=5.0;
btnBack.layer.borderWidth=2.0;
[btnBack setBackgroundColor:[UIColor colorFbBlue]];
btnBack.layer.borderColor=[UIColor colorFbBlue].CGColor;
[btnBack setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btnBack addTarget:self action:@selector(Click_On_Btn_Back) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backBarButton = [[UIBarButtonItem alloc] initWithCustomView:btnBack];
-(void)Click_On_Btn_Back{
[self dismissViewControllerAnimated:YES completion:nil];
}
這是我的推從以前視圖控制器SEGUE。
if([segue.identifier isEqualToString:@"segueFbShare"]){
FbShareViewController *fbVC=[segue destinationViewController];
fbVC.imageUrl=self.product.ImageUrl;
}
您是否將'viewController'作爲模態呈現?你在使用'navigationCotroller'嗎? – Firo
不是模態。這只是一個推動。我正在使用導航控制器。 – user1302602
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CE8QFjAA&url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FPush_Pop&ei=2pMCUvOwAYycigK49oHICQ&usg=AFQjCNFho3fVIKghJ -sSR_CAEVnpdpl3nA&SIG2 = IQvby_OKymbQKpz1pIwUPQ&BVM = bv.50310824,d.cGE –