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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:57:51+00:00 2026-06-09T12:57:51+00:00

I have a view in iOS (iPhone) that have multiple components, organized in sort

  • 0

I have a view in iOS (iPhone) that have multiple components, organized in sort of a stack way (one in top of the next). Those are user account properties, some could be blank.

So, I have in my view the components layout like this:

UITextField1 (Name)

UITextField2 (Location)

UITextField3 (Age)

UITextView1 (Bio)

UITableView (user entries).

Some of the fields could be blank. Instead of having blank spaces for the blank fields I would like the next field to move upper.

This is like this question of flowlayout: What is the best/easiest way to create 'flow layout' type layout in iOS.

I can only see two ways of dealing with this:

  1. Creating a function that traverse all the UIViews and determines which ones are blank and move the following upper.
  2. Creating a UITableView and use different cell heights for cells whose content is empty.

Ideally there would be a component, but I cannot find it (basically some sort of stack/flow layout).

Anyways, I believe that I am going to implement the option #1 above, but I don’t know if there is an “standard” way of accomplishing this (I honestly don’t even know the proper term to look for this feature).

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-09T12:57:53+00:00Added an answer on June 9, 2026 at 12:57 pm

    I would lean more in the direction of your second choice by using a UITableView but not the way you propose.

    This would be my approach using a UITableView:

    1. Create a UITableViewCell (or custom cell) for each one of my
      components and assign a tag value to each, we’ll use these later. You can do this in viewDidLoad.

    2. Add code in numberOfRowsInSection to check to see which fields have
      data values present. Return the total count of the number of fields
      with data values

    3. In cellForRowAtIndexPath again, check if data exists for that field
      If so, check to see if the cell created in step one has already been created or not (if not, create)
      If not, increment a counter of some sort to increase your tag value and find the next field that has a value. Once found, use that “tag/index” number to “return” the proper cell.

    In the end, you have a UITableView only displaying the fields with data.

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

Sidebar

Related Questions

So I have two TableView in one view of an iOS app. I have
I'm developing an iOS 4 application. I have a main view that contains another
I have an app that runs on iPad and iPhone running iOS 3.2, but
I have a universal iOS app with a custom view that has three buttons,
Basically, I want to have an app with only one view that has an
I have a view-based iOS cocoa touch application built and is running on iPhone.
I am creating navigation based iphone application.In that i have to move from one
I have an iOS app I created as a view-based app in xCode. I
I have a ios program for iPad. It is used 2 view, A view
In iOS apps, we have to register nib files with our table view before

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.