我正在使用带有 IOS6 的 Storyboard。我试图回到以前的视图控制器,但它不工作。
我在这里自定义了我的后退按钮。
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;
}