Not sure if this matters but when I run the view from IB the view looks fine. However, when I run my application from Xcode it shifts everything up. Just thought I'd put that out there.

On Oct 2, 2009, at 4:08 PM, Anthony Smith wrote:

Hm, I opted to set the view's programmatically rather than through a controller so I could control what view is initially displayed depending on the device (iPhone, iPod, etc.). I'm assuming I will be able to achieve something like this even when using view controllers?

On Oct 2, 2009, at 3:56 PM, Christopher J Kemsley wrote:

Hmm I have a few comments:

It look like you're seeing the superposition of two problems that look like one:

1) The status bar is covering up the very top of your view in the sim

2) The bottom button is 20px further from the bottom in the sim


The interface builder likes to make views default to a height of 460, not 480. I always change mine to 480 before I start using them. From your pictures, it looks like this is the culprit - that, and the status bar covering up the top. In order to change it, you must disable the 'simulate status bar' option in the view's inspector.

I believe that view is designed to be shown in a view controller who takes the status bar into account already. I also believe that you simply added the view as a subview of the window, which is what caused the status bar to cover up the top. (also, the interface builder shows you what the view would look like in a view controller that takes the status bar into account)

From this, you have a few options:

1) Disable the status bar in your application, set the view's "Simulated Interface Elements" to not show the status bar, then change the hight of the view to 480. To disable the status bar in your application, go to its info.plist, add a new row, scroll to the bottom, select "Status Bar is Initially Hidden" and set it to TRUE.

2) Use a view controller to show your view. I didn't fully understand just what the controllers did until after a very long time of tinkering, but they're a godsend... or, an apple-send in this case. They'll help making stuff like that line up, though only after you understand them.

or 3) Use both the above options (this is my recommendation)




On 2 Oct 2009, at 12:28 PM, Anthony Smith wrote:

When I run my app in the iPhone simulator the view seems to be shifted up on the screen. If that doesn't make sense I've uploaded some images. Take a look and see if you've run into this before.

http://projects.sticksnleaves.com/iphonedev/ib.png

http://projects.sticksnleaves.com/iphonedev/sim.png

Thanks!_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kd7qis%40gmail.com

This email sent to kd7...@gmail.com



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to