How to display controllers with proper aligning in iPhone screen ?

Posted by chatcja on Stack Overflow See other posts from Stack Overflow or by chatcja
Published on 2010-05-20T07:33:28Z Indexed on 2010/05/20 8:20 UTC
Read the original article Hit count: 146

Filed under:

I have a issue of displaying information in iPhone screen. Case is as follows.

  1. I crated a view-based application in Xcode name as myView.
  2. Then open myViewViewController.xib interface builder, change back groung color and added label at top-let (0, 0) of the view.
  3. Then I add new file named as myView2ViewController, which is subclass of UIViewController and corresponding XIB also generated.
  4. Open myView2ViewController in IB and added a label at top-left as previous. Also changed the background color.
  5. In the "applicationDidFinishLaunching" of AppDeligate do following

    myView2ViewController *mView = [[myView2ViewController alloc] initWithNibName:@"myView2ViewController" bundle:nil];

    [window addSubview:mView.view];

When I run the application, it is shown as upper part of the Label is sheared. It seems as whole UI has been moved 20 px upper (Because, there is a horizontal space in the bottom). I guess this is due to some positioning. But still I could not found any way to fix it.

Hope somebody will help me to identify this issue !!

© Stack Overflow or respective owner

Related posts about iphone