UINavigationController and presenting a modal controller

前端 未结 1 1358
暖寄归人
暖寄归人 2021-01-17 02:09

If got a rootViewController which display\'s a UIScrollView full screen. When I tap the UIScrollview, I want to flip the screen and display a settings screen (which also has

相关标签:
1条回答
  • 2021-01-17 02:55

    I've adopted Apple's solution which they use in the Metronome example.

    I'm setting the settingsViewController as the rootViewController for a navigationController. Than I display the navigationController using:

    [self presentModalViewController:navController animated:YES];

    As per apple's example, I've created a settingsViewControllerDelegate interface which the rootViewController adopts. The interface is not complicated, just a delegate instance var and a callback method (settingsViewControllerDidFinish) which needs to be implemented by rootViewController. In that methode you call:

    [self dismissModalViewControllerAnimated:YES];

    This way I'm able to have a couple of settings-screens using a navigationController and I'm able to return out of the navigationController back to the rootViewController.

    0 讨论(0)
提交回复
热议问题