0

I have a custom UITableViewCell and cell have 5 label like Name : ram DOB : 10/12/2012 Email:ram@gmail.com Phone :1234567890 Address : Bangalore

In the ViewController I'm showing one popup so that user can select what field he want to see in the table view. So how to achieve this while user can also select these fields randomly than there will be space in between two fields , how to handle all these any suggestion ?

Midas
  • 930
  • 2
  • 8
  • 20
Rajesh
  • 13
  • 5
  • based on the selected filters just hide/unhide the labels in the cell and reload once the user selects in popup. – RAJA Feb 12 '14 at 10:01
  • But if user will select filter randomly than space will come between two – Rajesh Feb 12 '14 at 10:23
  • "space will come between two" - you can solve this by auto layout constraints. Be aware, they it is a big area to study. – MrTJ Feb 12 '14 at 11:19

1 Answers1

0

You have a maximum of 5 possible items to display. Say the user taps on the button to display the popup, and choose to display 3 of the 5 items. You could then simply create 3 labels, add them to the cells contentView, and change the height for that cell depending on the total height of the displayed labels.

Nick
  • 939
  • 1
  • 12
  • 19