views:

181

answers:

1

I have a new view controller on the iPhone which I call using the following line of code:

[self presentModalViewController:controller animated:NO];

This works great if animation is on, but I am looking to have an instant switch. The problem is when I set animation to NO, the whole view shifts 20px to the right (it is always in landscape mode) as if there is a status bar but in portrait mode!?

In this example the yellow space is the new view controller.

alt text

I've tried this in a new project and the same thing happens. It may be a bug but does anyone have a fix? Thanks

+1  A: 

You should check the value of the controller.view.frame property, and make sure that it is correct. Most likely you will notice that the origin.x value is 20. However, I'm perplexed as to why the frame fits when animated.

Martin Cote
Hmm... I forgot to mention I'm using OpenFeint. Maybe this is the problem. Will get back to you on that...
ing0
Not sure how hacky this is but when I present the modal view I simply set the origin values to 0 and it's solved. However this isn't being changed anywhere else! It works tho :)
ing0