Reputation: 2099
How to push an ViewController display not as full screen on iPad like the image below
Welcome any comment
Upvotes: 2
Views: 2213
Reputation: 4050
From the screenshot I take it that you're doing something like this:
UIViewController* newController = LoadTheController();
newController.modalPresentationStyle = UIModalPresentationFormSheet;
[currentViewController presentModalViewController:vc animated:YES];
But your question is referring to the "pushViewController" method, which is related to UINavigationController objects, and there is indeed a navigation controller in the background of the screenshot. You might try looking into something like this:
[currentViewController.navigationController pushViewController:vc animated:YES];
Upvotes: 0
Reputation: 2329
We can present the modalViewController in four different way .ie 1. UIModalPresentationFullScreen 2. UIModalPresentationPageSheet 3. UIModalPresentationFormSheet 4. UIModalPresentationCurrentContext.
Here you are using third One now..
if you dont want to use these thing simply use the following code..
[self presentModalViewController Animated:YES];
Upvotes: 0
Reputation: 94834
Use UIViewController's modalPresentationStyle
property, along with the standard presentModalViewController:animated:
. Your screenshot is using UIModalPresentationFormSheet. There is also UIModalPresentationPageSheet, which displays fullscreen in portrait mode but leaves borders on either side in landscape.
Upvotes: 1
Reputation: 9544
The image you are showing is a type of modal view. You would display it with something like:
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[myViewController presentModalViewController: myModalViewController animated:YES];
See the documentation on UIViewController's for more info on modal views.
Upvotes: 0