Search code examples
iphoneiosios-simulatorios6

Unable to start my application in full screen on iPhone 6.0 Simulator Retina 4 Inch


I have added [email protected] to my project and set it in project settings, I have also set autoresizing options for my view and elements on that view which is initially loading on my application which is landscape-only, but after running my application in iOS 6.0 Simulator Retina 4 inch I see my application moved all the way left, leaving black pixel area on the right.

Any idea what should I do beside these things in order to see my application runs in "full screen" on iOS 6.0 Simulator Retina 4 inch?


[edit #1: AppDelegate]

I also edited my AppDelegate.m like this:

viewControllerMain = [[ViewControllerMain alloc] init];
//[window addSubview:viewControllerMain.view];
window.rootViewController = viewControllerMain;

[edit #2: Editing frame]

I managed to achieve full screen mode, but it's not working as it should. I do this in my views:

CGRect frame = CGRectMake([UIScreen mainScreen].bounds.origin.x, [UIScreen mainScreen].bounds.origin.y, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width);
self.frame = frame;

This only brings my view to full screen, but black area on the right I mentioned on the beginning is dead and no user interaction is possible in that area (I have UIButton there which doesn't react on touch). So basically, what I did only made my view appear in full resolution, but functionality of elements on view is limited to area where my app originally showed when I first started it on Retina 4 inch simulator.


[edit #3: Changing size of UIView's in XIB files]

I even tried to change actual size of UIView's in my XIB files resizing them all to Regina 4 Full Screen, but still - same thing.


[edit #4: Changing size of window object]

I have tried to change size of window object in AppDelegate.m but again no luck. Here's how AppDelegate.m look like.

application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;

mainViewController = [[MainViewController alloc] init];
window.rootViewController = mainViewController;

// Override point for customization after application launch
[window setFrame:[UIScreen mainScreen].bounds];
[window makeKeyAndVisible];

[edit #5: "Solution"]

So far I did following: In IB I made new UIViews with iPhone 5 resolution size, assigned same owner classes which are handling their equivalent UIViews made for pre iPhone 5 resolution and in code where do I need to load some of these UIViews I check [UIScreen mainScreen].borders to determine which device is currently running my application. In this way, I managed to get things work.

But still, main question remained - why didn't all my UIViews automatically stretched to new resolution after I did all those things I mentioned?

Anyhow, bounty remains active for 5 or 6 days. If someone manages to solve this issue, I'd be very grateful. If not, I'll give bounty to @onegray, since that was the thing I didn't took care of at first place, and in my current implementation it is really important.

Best regards.


[edit #6: MainWindow.xib Full Screen at Launch option]

As @user1702985 suggested, I turned this option ON as it was deselected. But no luck.

When I start my application I show one View for 2 seconds with one UIImageView on it. If I set Autosize properties right, this UIView is shown in fullscreen on iPhone 5 simulator. BUT. After that I have second UIView which contains vertical UIScrollView, UIViews as header and footer and one UIButton, and I also set all autosize options for these elements, but this UIView is shown in iPhone 4-- resolution. It really acts strange and I still don't know what can it be.


[edit #7: Auto-resizing options which are set]

This auto-resizing option is set for all my UIViews and it's elements.

enter image description here


[edit #8: Explanation of Full Screen at Launch option]

MainWindow.xib properties.

enter image description here


Solution

  • Make sure that key window has proper size. Workaround is to set proper frame: [window setFrame:[[UIScreen mainScreen] bounds]].

    Update:
    It is difficult to guess where is the problem without having the source code. I've created simple app stub to test interface orientation for iPhone4/iPhone5. I just created new "Single View Application", added some subviews to the root view, and added "Defaults" images. I did it in Xcode 4.3.2 without any extra features of Xcode 4.5. And app automatically stretches its screen to proper size (for both portrait/landscape orientations).