I have an application based off of the UISplitView project template. It works great.
But now i'd like to have a full-screen view, like a modal view. How can this be done so that it takes up the entire screen space?
If not possible, i suppose i could create a UIPopover view and make it fill up the whole screen, though i'd really like the view to take up the entire screen (without the popover type of view bordering).
Maybe I'm missing something, but can't you just create a view controller and present it modally? It works fine with splitview controllers. In other words:
MyModalController *mc = [[MyModalController alloc] initWithNibName:#"MyModalController" bundle:nil];
[self presentModalViewController:mc animated:YES];
[mc autorelease];
Related
I want to have a view in my application to be displayed just like app store showing application.
I mean a view in middle of page, smaller than iPad actual size, and the rest of view is dimmed.
just like this:
should i use modal or what?
Thanks.
From code:
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:myViewController animated:YES completion:nil];
If you use storyboard you can also set modal segue with FormSheet style.
I have a xib view file, created for iPhone, now I making iPad version. It is opens fine, but in the left top corner of the Detail View. I need to open it in the middle of the Detail View. I don't need to resize it, I just need to locate it in the middle of the Detail View. How can I do that? My code for open that xib file is...
NSArray *viewControllers;
StarsViewController *stars = [[StarsViewController alloc] initWithNibName:#"StarsViewController" bundle:[NSBundle mainBundle]];
viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, stars, nil];
self.splitViewController.viewControllers = viewControllers;
If you're trying to place an iPhone-sized view controller as a component of an iPad app, I would suggest making the iPhone VC a child view controller and the full-screen iPad VC the parent view controller.
If you're using Storyboards and iOS 6 or later, container views and embed segues make this really easy. You just create a container view in your parent view controller, then control-drag from that container view onto the VC that you want to be the child, and set it up as an embed segue. At runtime, iOS does all the housekeeping required to set up the child view controller for you. It's great.
My app was working great and then client asked to put a login screen on.
I have a TabBarController with 4 tabs and I assign it the window as such in my app delegate.
[self.window addSubview:self.tabBarController.view];
Next, I had to put a login screen (view Controller) so I did it and called it like this
[self.tabBarController presentModalViewController:passwordController animated:NO];
and then dismiss it when the login is correct.
Now, when I put the app in the background each time I get my login screen (YEAH) with the exception of one. One of my tab's calls a navigation controller (well MasterViewController here is actually a view controller) and I call it like this
MasterViewController *masterViewController = [[MasterViewController alloc] init];
//TRYING TO GET IT TO STAY WITH TAB CONTROLLER
UINavigationController *navController = [[[UINavigationController alloc]initWithRootViewController:masterViewController] autorelease];
[self presentModalViewController:navController animated:YES];
and dismiss it when I need to. From there I am doing a bunch of core data stuff and I wanted my tab bar to disappear as I wanted the user to add/edit order in the correct order and not jump around to another place in the app using the tab bar (and then data being out of sync).
When I need to "drill down" to the next level I use
[self.navigationController pushViewController:eventController animated:YES]; and pop when I need to dismiss it.
So my question is this...I want the login screen to be presented on top whenever I return from the background on all screens.
I am sure the problem is the creation of the NavigationViewController not being part of that tabBarController
I did not include more code because it's all core data stuff or view controllers and all works well.
I am sure I am doing something terribly wrong and just don't understand (and I've built the entire app using advice on here so perhaps I followed bad advice).
I solved the problem like this..I created a navigation controller for each of the tabs that needed to "drill down" and had those navigation controllers initialized using the tabbarcontroller. Then in the app delegate when the appfinishedLaunching I called the security controller and it works everywhere. Just wanted to post for those who might be interested.
On a TabBar-based application on the iPad, is there a way to present a modal on top of it in "FullScreen"?
I have a LANDSCAPE ONLY APP (if that makes a difference) and the item I want to currently present modally I would like to present full screen, filling the entire screen just to clarify. I can present it in "PageSheet" fine, and "FormSheet" is all right, after a few button adjustments on the modal view nib, but once I try "FullScreen", the background goes white (TabBar still there, though), and if I retry hitting the button (without restarting the simulator), it won't respond.
The view where the button is located to present the modal view is CountryViewController.m and has the action:
-(IBAction) showNewModal:(id)sender {
modalContent.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modalContent.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:modalContent animated:YES];
}
This code works fine without the TabBar, I've realized. I've looked for hours for something to add to this code or even in the AppDelegate.h and .m files but so far, it's either unresponsive (oddly enough without showing an error) or the aforementioned white space.
in my experience the problem comes from presenting the modal from the wrong controller.
[self.tabBarController presentModalViewController:modalContent animated:YES];
should work
If you work with iOS 4 a (maybe) beter options is to use:
[[UIApplication sharedApplication].keyWindow.rootViewController presentModalViewController:modalContent animated:YES];
I would like to have a root level controller that appears to be a splitview but I would also like to allow the detail view to essentially take over the entire screen (in both landscape and portrait orientation) - and not as a modal view.
By way of context, my iPad app shows the user a list of experiments (collections of data sampled from sensors) in the master view. Selecting an experiment causes details of experiment (e.g., title, sample rate, etc.) to be displayed in detail view. But I would also like to be able to tap on a button in the detail view and transition to a full-screen graph of, for example, data vs. time.
So, I am wondering if anyone has done this. I already have tried it the other way (uinavigationcontroller within detail view of splitviewcontroller) but that doesn't seem to allow for the full-screen aspect.
Thanks in advance.
I think that a modal view overlay with a full page style would give you what you want.
YourVc * vc = [[[YourVc alloc] initWithNibName:#"YourVc" bundle:nil] autorelease];
[self.splitViewController presentModalViewController:vc animated: true];
The default style for the overlaid modal view controller will take up the entire screen (it won't be a popup.)