so, i have an ios app and i have built it with interface builder and xcode. I built it using interface builder in the horizontal view because that is how i want my app. I have also made the supported views landscape left and right and i have edited info.plist to make it open horizontally.
But when i build and go it opens in iphone simulator horizontally but it shows as it would if it was vertical.
here's some screenshots:
what i want it to look like:
http://www.sendspace.com/file/4ct4b0
what it actually looks like:
http://www.sendspace.com/file/fayjqj
how could i get it to open like i want??
You have to allow the orientation also in your implementation of UIViewController using shouldAutorotateToInterfaceOrientation :
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return YES; //or UIInterfaceOrientationIsLandscape(interfaceOrientation) for just landscape
}
Also, if you have some more problems look on linked SO questions to this "out-dated" question:
iPhone app in landscape mode, 2008 systems
Related
I am currently in the process of testing if my app works on both iphone and ipad and setting up the respective autolayout. For some reason on this particular viewcontroller, when I switch from iphone to ipad 9.7 the viewcontroller does not change the height and width of its view resulting in something that looks like this. Also, I am only having issues with this particular storyboard. The rest adjust their views to the correct size like they are supposed to .
I am developing a xamarin forms app and I want to restrict the app's supported orientation to be Portrait only. I have indicated so in the info.plist file. But, the app still rotates when I rotate the device / simulator. What am I missing ?
This seems to be a bug in Xamarin Studio in that the GUI checkboxes only affect orientation for iPhone, not iPad. I will get a bug report filed, but in the meantime just view the Source for the Info.plist (Click the Source tab at the bottom of the Info.plist document and look for Supported interface orientations (iPad) which contains an array of values. Delete all of the values except Portrait (bottom button) from the array for Supported interface orientations (iPad)
UPDATE: Bug filed: https://bugzilla.xamarin.com/show_bug.cgi?id=50552
I try to build a simple app based on the UISplitViewController template from Xcode 6 for universal apps (with Storyboard and CoreData/NSFetchedResultsController). This app should also provide a search bar for the MasterViewController. Unfortunately, Xcode 6 provides no InterfaceBuilder element for the UISearchBar/UISearchController combo (only the depreciated UISearchBar/UISearchDisplayController).
In the iOS Developer library, Apple provides the "Table Search with UISearchController" example, but this is not based on the UISplitViewController and supports only iPhone.
My problem is, that I'm not able to show the detail view on the correct ViewController under all circumstances. I tried to transfer the approach from the Apple example project to the UISplitViewController template. In this, one is encouraged to show the search results in a separate UITableViewController subclass (ResultsTableViewController) and use this as the searchResultsController of the UISearchController. I was not able to create a scene in InterfaceBuilder for this setup so I had to add these manually in code.
The problems begin when I click on a table cell of the ResultsTableViewController. This vc is not part of the scene in InterfaceBuilde and I don't know how to add it to the SplitViewController setting correctly. The biggest problem is the weird behavoir of the iPhone 6 Plus and the UISplitViewController. In portrait mode it behaves like an iPhone and doesn't seem to have a SplitViewController and only uses a NavigationController to which I push my DetailViewController. In landscape mode it behaves like an iPad with SplitViewController were I have to get the second ViewController of the SplitViewController childControllers and push the DetailViewController on this one.
Now it happens, when I start in portrait mode and switch to landscape mode that the DetailViewController is all gone, showing gray space where the DetailVC should be. It seems, when going to portrait mode, the DetailViewController gets kicked from the SplitViewController (or the SplitViewController gets kicked at all in favor for the iPhones NavigationController setup). When switching back to landscape the SplitViewController is initialized again but without proper initialization of the DetailViewController.
Is there any template or suggestion on how to correctly implement search capabilities on a universal UISplitViewController?
Cheers
Björn
I have just run into a problem regarding how my app launches. Even though I have selected launch from portrait my app always launches in landscape view and I have to rotate my iPod to make it switch to portrait.I have been mainly working in the storyboard section of my app and don't have much code at this point. Do I need to enter some code to launch from portrait? Thanks, I am a beginner and am very grateful for any help.
Make sure you follow these 3 steps:
1) On the .plist file make sure landscape is listed as one of the supported orientations.
2) On the viewcontroller for that view make sure that your code returns yes for the should autorotate...
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
3) On the IB select your initial view and then on the fourth tab from the property inspector, under the simulated metrics make sure that Orientation Landscape is selected.
How to make an iOS app support landscape orientation?
How do you make it support both landscape and portrait, where you can just press a button to activate it.
for any new people reading this old post just go to main.storyboard->click on the view controller click on simulated metrics (the fourth icon that pops up, looks kind of like a pentagon belt buckle)
then orientation->Landscape this is for Xcode 5