search

Home  >  Q&A  >  body text

ios - Controller A jumps to controller B, and screen B goes black?

1. There are two VCs in storyBoard, each with navigation.

2. AVC jump method to BVC, button connection method

- (IBAction)clickBtnToBvc:(id)sender {
    BViewController *vc = [[BViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

3.BVC black screen, what is the reason?

天蓬老师天蓬老师2739 days ago859

reply all(3)I'll reply

  • 世界只因有你

    世界只因有你2017-05-31 10:35:00

    Your B is created in the storyboard and bound to the control, so it needs to be loaded from the storyboard

    BViewController * vc = [[UIStoryboard storyboardWithName:@"storyboard" bundle:nil] instantiateViewControllerWithIdentifier:@"IDENTITY"];
    [self.navigationController pushViewController:vc animated:YES];

    reply
    0
  • PHP中文网

    PHP中文网2017-05-31 10:35:00

    Try setting a background color for the view of BViewController

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-31 10:35:00

    Delete the navigation of b

    reply
    0
  • Cancelreply