Искам да използвам UIModalPresentationFormSheet в моето приложение. Но аз използвам навигационен контролер. Така че, когато напиша следния код, той не ми отговаря. Какво трябва да направя?
[self.navigationController pushViewController:controller animated:YES];
Отговори:
3 за отговор № 1Проверете с работния код по-долу за пример.
MyModalViewController *targetController = [[[MyModalViewController alloc] init] autorelease];
targetController.modalPresentationStyle = UIModalPresentationFormSheet;
targetController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; //transition shouldn"t matter
[self presentModalViewController:targetController animated:YES];
targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it"s important to do this after
presentModalViewController targetController.view.superview.center = self.view.center;
Взета от ->
Как да промените размера на UIModalPresentationFormSheet?
6 за отговор № 2
Опитайте нещо подобно:
// assume controller is UIViewController.
controller.modalPresentationStyle = UIModalPresentationFormSheet;
Тогава
[self.navigationController presentModalViewController:controller animated:YES];