views:

36

answers:

2

I dont know if I am missing something here but when I drop elements (UIImage or UILabel) in IB and run the app in simulator, the UI elements are shifting up a little (Snapping to status bar if I place them at first blue HIG line).

Looks like some setting I am overlooking. Does this sound familiar? please help!

Added Screenshot to explain whats going on ...

  1. In Interface Builder

alt text

  1. In Simulator

alt text

+1  A: 

Try this: select the view in Interface Builder and then in the Inspector, under “Simulated User Interface Elements,” change the status bar to “Gray.”

alt text

Jeff Kelley
I tried that earlier ... it was not working ... added screenshots to the question above. Thanks.
Dev
A: 

Ok ... heres whats happening in detail - http://discussions.apple.com/message.jspa?messageID=10861335

And heres what I did to resolve this - In the view controller code

- (void)viewDidLoad {
     CGRect newFrame = self.view.frame;
     newFrame.origin.y += 20;
     self.view.frame = newFrame;
    [super viewDidLoad];
}

Just move the frame of the newly added view (first view to the window) 20 pixels down and everything should fit nicely. This some how fixes view position for following views also. Dont know how?

Then you will see the UI elements exactly in the same position in Simulator and Device as you see in IB.

Hope this helps :)

Dev.

Dev