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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:16:57+00:00 2026-05-24T06:16:57+00:00

I have a configuration UITableView that can launch a colour picker via a UINavigationController

  • 0

I have a configuration UITableView that can launch a colour picker via a UINavigationController approach:

[self.navigationController pushViewController:colorPickerViewController animated:YES];
[colorPickerViewController release];

The effect of this means the ColourPicker will have a navigation bar at the top ( and back button)

The structure of the ColourPickerViewControll and it view ColourPickerView is as follows:

- ColourPickerViewController - in it's XIB file at the top level view it has:
  - ColorPickerView : UIView (i.e. custom UI view) - in it's methods it has:
    - (id)initWithCoder:(NSCoder*)coder  {
       if ((self = [super initWithCoder:coder])) {
         CGFloat currVertBounds = self.bounds.size.height;

The issue here is the the value of currVertBounds is coming to 480, so it’s not taking account of the navigation bar

QUESTION: How do I get the true displayed height of the ColorPickerView instance?

Is it something to do with trying to get the layout calculated in the custom UIView, and perhaps the custom view isn’t rendered within the overall controll/navigationController at that stage?

  • 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-05-24T06:16:58+00:00Added an answer on May 24, 2026 at 6:16 am

    You’re reading bounds too early. None of the layout/subviewing magic that happens in UIKit will take place during [super initWithCoder:]. You should be reading bounds and laying out your view either:

    1. In viewDidLoad/viewWillAppear, and set up the autosizing parameters for all manually created UI elements so they can get moved around with respect to different interface orientations. In these functions I wouldn’t rely on bounds being exactly correct but I would say it’s at least the right height:width ratio. It could possibly be in the wrong orientation, though.
    2. In viewDidAppear, if you wish to manually position elements. By the time you hit viewDidAppear all of the resizing and such has taken place, and the only thing left to worry about is future rotations, which you should adjust your view for in willAnimateRotationToInterfaceOrientation:duration:.

    Docs on willAnimateRotationToInterfaceOrientation:duration: state:

    By the time this method is called, the interfaceOrientation property is already set to the new orientation. Thus, you can perform any additional layout required by your views in this method.

    iOS 5.0 docs add the clause:

    …set to the new orientation , and the bounds of the view have been changed. Thus…

    I think this is still the case for prior iOS versions.

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

Sidebar

Related Questions

People says that libraries shouldn't have configuration files. I can't pass arguments to my
I have some configuration data that I'd like to model in code as so:
I have a project where there are multiple applications that have some common configuration
Can I have different configuration of rows in different section of table view? This
I have a configuration object that contains values to be populated to the UI.
I have some configuration files to commit on GIT with default parameters. Users can
I have a configuration file that has variables and value separate by spaces. I
Let's say I have a configuration property that looks like this. Note that there
I have a UITableView with some login form and I manually wrote the configuration
I have some configuration values in a YAML file that needs loaded when my

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.