Akshay
Akshay

Reputation: 2983

Layout Issues while running the app in iPad 6.0 Simulator

This is a bit uncertain situation for me now after upgrading my XCode to 4.5 and testing the app on iPad 6.0 simulator.

Details- When I am running the application on iPad 6.0 simulator a lot of views/layouts and orientation issus are coming up. But when I downloaded the same application from App Store on my iOS 6 iPad device then my app is working fine.

I am testing it on simulator to support my app for iOS 6 too. What can be the reason for this kind of happening?

Thanks

Ak

Upvotes: 2

Views: 833

Answers (4)

Akshay
Akshay

Reputation: 2983

After reading the UIOrientation delegate method changes in iOS 6 I made these changes to solve the issue-

1) Used this method for resetting the layout -

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration

2) If this delegate is unable to get the current orientation of device I used this to get it -

UIInterfaceOrientation orientation= [[UIApplication sharedApplication] statusBarOrientation];
    [self willAnimateRotationToInterfaceOrientation:orientation duration:1.0f];

These things solved my problems.

Thank you for your help and response. :)

Upvotes: 0

Noah
Noah

Reputation: 34

maybe autolayout is activated! I heard it is a bug witch isnt fixed on the simulator yet. wait for update then it should work for you! :D

Upvotes: 0

Ganesh S Bhat
Ganesh S Bhat

Reputation: 237

While setting frames for the subviews programmatically, instead of using self.view.frame you can use,

[[UIScreen Mainscreen] bounds]

which will return the frame for the current device. For example if you are using 3.5 inch retina screen it will return frames (0 ,0, 320, 480) and if you are using 4 inch retina it will return frames (0 ,0, 320, 568). So it is easy to handle layout issues.

Upvotes: 0

Nate
Nate

Reputation: 31045

Have a look at the answer I posted to this other similar question.

Basically, I was seeing what you are seeing, too.

The answer I link to has a link to the pre-release Apple developer forums (need a developer account to access), where there is a discussion of this issue (if I'm reading your description correctly). If you scroll to the bottom of the thread, you'll see multiple developers stating that, like you, they see their existing apps (on the App Store) running without problems on iOS 6 devices.

It's just that when compiled with Xcode 4.5, and then run on iOS 6 devices (or simulators), they see the problem. Since your app in the store was compiled with an older version of Xcode, iOS 6 users who currently have your app should be fine.

But, when you start submitting new apps or updates, built with Xcode 4.5, you should make the fixes I list in my other post.

Upvotes: 2

Related Questions