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 9169779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:55:33+00:00 2026-06-17T15:55:33+00:00

I have created 2 child views inside my view controller to be swapped between

  • 0

I have created 2 child views inside my view controller to be swapped between each other based on 2 different buttons.

a la, button 1 shows childview1 etc.

However, when I start the app in landscape mode and print out the bounds for the childviews in viewDidAppear, the bounds are still incorrect.

So basically,

  1. In view controller’s viewDidAppear method, i create 2 childviews, then i immediately print out bounds here for the viewcontroller. they are correct.

  2. In the childviewcontroller’s viewDidAppear method, i also print out the bounds AFTER i know they are correct for the parent and they are still incorrect.

so the output looks like this..

ViewController Bounds Height2:748.000000 Width: 1024.000000   
Child Bounds Height:1004.000000 Width: 768.000000

and when the app loads, my viewcontroller has correct dimensions, and the childs do not.

Any ideas? is there some way to set the childs boundaries on creation?

Thanks

  • 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-17T15:55:34+00:00Added an answer on June 17, 2026 at 3:55 pm

    I think the problem is that you never set your child view controllers’ views’ frames from anywhere outside of the child view controllers. Within your parent view controller’s viewDidLoad method (or the viewDidAppear method, if you like) and after the child view controllers have been initialized, set their frames using the parent view controller’s bounds.

    For example, you might put the following in your parent view controller’s viewDidLoad method:

    childViewController.view.frame = CGRectMake(0, 50, self.view.bounds.size.width, self.view.bounds.size.height - 50);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view controller, which creates 2 view controllers inside it. Inside each
I have a scenario where i created pipe for communication between two child and
I have a viewstack with a repeater inside to create each child. Soemthing like
I have created a navigation controller and its child controllers in storyboard (Interface Builder).
I have three views that I've manually created in the DB. First view is
I have a parentview which dynamically creates a child view and I have triggered
I have created a window whose handle is handle_parent. Then I created a child
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have two model classes, say parent and child. Parents are created first, and
I have objects which create other child objects within their constructors, passing 'this' so

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.