iphone - Best layout for detail views with heterogeneous rows -


I have sometimes not seen an ideal layout strategy for the description of many odd rows, such as a line for the name, For an address, for an email, for an age ..., just like editing the name of the contacts, but more complex

Obviously, this is a true "table" thing, and the group style of UITableView is better for plain lists of rows (see editing names named contacts).

However, UITableView is not sufficiently flexible to handle the diversity: tableview: cellForRowAtIndexPath: The method becomes distorted with complex branches for different types of rows, such as:

  switch (line) {case kNameRowIndex: nameField.text = name; break; Case Cadresro Index: addressField.text = Address; break; Case kEmailRowIndex: emailField.text = Email; break; Case KAZONDEX: ageField.text = Age; break; ... Default:}  

This problem can be solved completely if UITableView can be populated in the stable UITableViewCells interface builder, which seems impossible, is not it?

What is the best layout strategy for such expanded ideas?

This static UI is not exactly impossible in the layout in Visual Seite interface builder.

In your visual controller you can set IBOutlets for the different cells you want to use. In the XIB file for your visual controller, define the UTTableViv cells that are not in the main view and wire those outlets. When the view loads, you will have custom UITableViewCells which you can return.

The only difficult part is that if they are different from the heights, then be sure to implement heightForRowAtIndexPath: so that you can return the frame heights for the stable cells.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -