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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:21:11+00:00 2026-05-15T16:21:11+00:00

I’ve got a simple form in my iPhone app. The form is laid out

  • 0

I’ve got a simple form in my iPhone app. The form is laid out and managed via IB and the typical wiring (i.e. I am not creating this form programmatically).

One of the fields (and its associated label) should be shown only if a particular preference is set.

I could set the field and label’s alpha to 0 and disable them in this case. The problem is that the fields below this now-invisible field would remain in the same place and there would be a big blank area. My goal is to have the screen look normal in either state.

Is there a way to programmatically remove (or add) UI elements and have those below shift up or down to make room? Or should I consider making a whole other NIB file for this second case? (and, if I do that, is there an easy way to share the common elements?)

Current UI with both controls shown

With Both http://img.skitch.com/20100704-bm41w6wtqkdgh1da99ihb7g32d.jpg

UI with optional control hidden via alpha == 0

Using Alpha to Hide http://img.skitch.com/20100704-q2sxrj3nf6ya68wp6ubn86n2pa.jpg

Desired UI with optional control hidden

Desired when hidden http://img.skitch.com/20100704-82r876pgctee8gb51ujg1dwj7k.jpg

  • 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-15T16:21:12+00:00Added an answer on May 15, 2026 at 4:21 pm

    When every UI element is linked to a IBOutlet pointer, e.g.

    @property (nonatomic, retain) IBOutlet UITextField *field_a;
    @property (nonatomic, retain) IBOutlet UITextField *field_b;
    @property (nonatomic, retain) IBOutlet UITextField *field_c;
    // ...
    

    You can test each element’s visibility by:

    if (field_a.hidden) {
        // ...
    } else {
        // ...
    }
    

    And move them around:

    CGPoint pt = field_a.center;
    pt.y -= 60;
    field_a.center = pt;
    

    Or by some animation:

    CGPoint position = field_a.center;
    position.y -= 60;
    [UIView beginAnimations:@"MoveUp" context:NULL];
    [UIView setAnimationDuration:0.5];
    field_a.center = position;
    [UIView commitAnimations];  
    

    To hide an element:

    field_a.hidden = YES;
    

    To show an element:

    field_a.hidden = NO;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

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.