Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a UITableView similar to the iOS Contacts app?

I would like to create a table that is editable similar to the fields in Contacts. They appear to be grouped, using UITableViewCellStyleValue2, but the cell style changes when it becomes editable into something that I cannot recreate that has a vertical line between the textField and the detailTextField, and the detailTextField is editable. Is this cell a custom UITableViewCell or is there an out of the box configuration for this?

I am basically trying to create a table to edit address information exactly like this app.

like image 698
user663559 Avatar asked Mar 17 '11 02:03

user663559


People also ask

How tableView works in iOS?

Table views in iOS display rows of vertically scrolling content in a single column. Each row in the table contains one piece of your app's content. For example, the Contacts app displays the name of each contact in a separate row, and the main page of the Settings app displays the available groups of settings.

What is tableView?

A table view displays a single column of vertically scrolling content, divided into rows and sections. Each row of a table displays a single piece of information related to your app. Sections let you group related rows together. For example, the Contacts app uses a table to display the names of the user's contacts.


1 Answers

There is a sample developer IOS app called iPhoneCoreDataRecipes that shows how they do something like this.

In the file: IngredientDetailViewController.m when loading the table data they have the line:

[[NSBundle mainBundle] loadNibNamed:@"EditingTableViewCell" owner:self options:nil];

Looking at the EditingTableViewCell.xib file, you see that they have a Table View Cell with a Label and Text Field, the IngredientDetailViewController passes the values for the label and text fields.

Using that trick, you should be able to easily customize the TableViewCell to your liking. :-)

like image 121
Adam21e Avatar answered Nov 05 '22 20:11

Adam21e