iPad orientation - objective-c

I have question regarding changing orientation on iPad.
I use MonoTouch, but if Obj-C programmers can help, it will be just as great.
First of all, I figured out if I provide different splash screen images for different orientations, app will show the right one. This can be done for any orientation, such as "Default-LandscapeLeft.png", or generic one "Default-Landscape.png".
All of my images are of correct dimensions and yet, when I start it in portrait mode, it shows it enlarged. All of other modes work perfectly well.
Second problem is I want my app to continue to be in that orientation after my first controller appear. At the moment, it shows portrait in any case. I started generating orientation notifications before first controller appeared (UINavigationController), but I think it responds only on orientation changes. After I moved device, it rotates and from that moment, everything works fine. BUT, I want to "inherit" orientation info from my splash screen.
Any idea will be appreciated.
Thanks guys and girls.
Cheers

Images for different orientations:
Default.png and Default-Landscape.png should be provided + setting the app settings to provide the required orientations.
Second problem:
After creating the first controller call
myController.WillRotate(UIApplication.SharedApplication.StatusBarOrientation, 0);

Related

How to remove splash screen at all, so that game loads at once ? Cocos2d + SpriteBuilder

I have my problem still unsolved Splash screen is landscape although the whole game is in the portrait mode. SpriteBuilder + cocos2d , so I see only one way.
How to remove splash screen at all, so that game loads at once ?
This is not possible. An image named Default.png (or under a similar name, depending on the device and what the app supplied) is always loaded when an app launches.
This is done by iOS specifically because no app can technically launch instantly (as in: within a tenth of a second or two).
I know the question is old, but I had the same problem and I solved it specifying none in "Launch screen file" (under General settings).

xCode: setView always portrait though device in Landscape

I have encountered a problem developing an iPad app with xCode.
When I load a view into my rootViewController like this
[self setView:viewController.view];
The view is always displayed in Portrait even though the device is rotated to landscape.
I checked all options and tried changing the shouldAutoRotateToOrientation method and it seems to have nothing to do with it.
If I rotate the device to portrait and then back to landscape it works.
Does anybody know why this is happening?
Best regards,
Matteo
The problem was that I was nesting viewControllers which leads to bad behavior like rotation notifications not being sent to certain ViewControllers.

Black screen when loading iPad Storyboard.

So I am working on an app https://github.com/Kronusdark/PerlinNoiseKit and I had a (crappy) iPhone UI going, but I decided to make it run on my iPad. The problem is that when it loads the iPad storyboard, I get a black screen. I have checked my project summary and it is pointing to the correct storyboard file. The outlets all appear to be set correctly, and it will actually run code in my viewController on my iPad. I just get no UI. I have pushed my most recent changes to my repo if anyone wants to try to run it, any advice would be helpful.
Eureka! It turns out one of my sub-views were not working properly. After I removed the offending view my storyboard loaded no problem. I believe it was due to a rogue drawRect:.

iOS App Portrait and Landscape Views

I'm trying to make and iOS app with both portrait and landscape views, but if I open it and change the orientation to Landscape, some buttons got offscreen, after going to IB and reordering the buttons, in Portrait they go off screen.
After googling, I dont have ANY ideia how to 'change' views according to orientation.
Could you guys give me some help?
Ah, also, Apple Support Documents seems pretty useless to me :P
Thanks!
There a method - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{}
which is useful in such cases.
You should change autosizing properties in IB (they're in the same place where frame size is) or change autoresizingMask properties of your inner views and controls programmatically. This controls what happens to the elements of your screen after it gets resized (for example when the screen is rotating). You can glue your components to left or right or both, top or bottom or both and similar. Play with it, it's pretty powerful and you don't need any code for that if what they can do is enough.

how to change mainwindow.xib's orientation to landscape? [duplicate]

I appreciate I'm probably missing something basic here, but...
My iPad app will only support landscape mode, and has a MainWindow.xib Window that I'd like to work on in landscape mode in XCode 4, however the pull-down menu to change this (Simulated Metrics -> Orientation) is always grayed out.
I notice that Views can be rotated just fine, it's only Windows that can't be rotated in XCode 4 using this setting.
Is there a workaround for this, or do I have to put a View on top of the MainWindow in order to rotate it?
I think it's because apps always starts up in portrait and then rotates to appropriate oriantations. From the UIViewController docs:
Note: At launch time, applications should always set up their
interface in a portrait orientation. After the
application:didFinishLaunchingWithOptions: method returns, the
application uses the view controller rotation mechanism described
above to rotate the views to the appropriate orientation prior to
showing the window.
So you'll need the UIViewController magic for the simulated metrics to make any sense. If you used the "Window-based application" template as a starting point for your project try the "View-based application" template instead.