Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:04:57+00:00 2026-06-14T22:04:57+00:00

I load InfoViewController’s view as a subview in MainViewController like this (declared in .h):

  • 0

I load InfoViewController’s view as a subview in MainViewController like this (declared in .h):

- (void)viewDidLoad
{
[super viewDidLoad];
infoViewController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
mainInfoView = (MainInfoView *)[mainInfoViewController view];
 }

(MainViewController is push-presented from a segue from a tableviewcontroller cell and has a navigation bar.)

This is in InfoViewController‘s viewDidLoad to set the size of view:

- (void)viewDidLoad
{
[super viewDidLoad];
self.view.frame = CGRectMake(130, 0, 178, 299);
}

In the Size inspector for InfoViewController I’ve set the same size (with: 178, height: 299).
I disabled “Use Autolayout” both for InfoViewController in XIB and for the MainViewController in Storyboard.

I have some UILabels, UITextViews and UIImageViews in the InfoViewController. They are declared with properties in .h and synthesized in .m. and connected to the elements in the XIB. Their content is defined in viewWillAppear of MainViewController like this:

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
 infoViewController.kategoriLabel.text = [[objArr objectAtIndex:detailIndex] objectForKey:@"Type"];
 }

When I run the app and this view is entered, some of the labels, images and textViews are suddenly placed in what appears to be random locations. This is only happening to some of the elements.

I have done this same thing in another app and it works fine on both simulator (iPhone 4 ver 6,0) and iPhone 5 device, but in this app it just gets messy on both.
I cannot seem to find anything different anywhere in the Utilities or anywhere else when I compare the apps.

If you have experienced something similar and solved it or if you might know what could be causing it, I will appreciate your answer. Thanks.

PS. I’m using Xcode 4.5.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:04:58+00:00Added an answer on June 14, 2026 at 10:04 pm

    I had a different problem, but my brute-force resolution might work for you as well. In my case, I wanted to disable the nav bar on the final item in a series of view controllers. IB, though, won’t let you remove the Nav bar so I had to do it manually in viewWillAppear. However, once the bar was hidden, IOS shifted up all my buttons and objects that had been defined in IB by the height of the (now hidden) nav bar.

    I resorted to the following in the Controller’s viewWillAppear. (objects tended to shift visibly when I tried this in viewWillAppear)

    -(void) viewWillAppear:(BOOL)animated
    {
        //turn off nav bar
        [[self navigationController]setNavigationBarHidden:YES animated:NO];
    
        //correct positions of items that shift when the bar disappears
        myThing.center = CGPointMake(desired_x_coord, desired_y_coord);
        myOtherThing.center = CGPointMake(desired_x_coord2, desired_y_coord2);
        ...etc...
    
        //don't forget to call the base class
        [super viewWillAppear:animated];
    }
    

    Annoying, but worked. If you can’t find the source of your objects moving, you could try forcing their positions using viewWillAppear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I load some .wav files in my iPhone app like this: SoundEngine_LoadLoopingEffect([[bundle pathForResource:@loop ofType:@wav]
I load in a div with class name .preview image's gallery like this: <img
I load a page, saw on twitter, using a line like this: [self.webView loadRequest:[NSURLRequest
I load a html page in web view in this way: NSString *description =
load.js: jQuery(document).ready(function($) { $('.dialog ul li').click(function(e) { switch($(this).attr('id')) { case 'addProject': $('.addDialog').load('/add/addprojectform'); break; case
I load this JS as a separate file, so it is then available after
I load some html using AJAX, this works fine, one of the bits that
I load a user control in a web page which throws an exception: this.LoadControl(someusercontrol);
I load files to a TextBox, and I would like some of the information
I load everything on my page. At the end, I have this script. <script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.