IOS controls

Possible duplicate:
How to create an editable UITableView, such as a Contacts application? (iPhone)

I am trying to create a form that looks like an iOS contacts application, where each line has a field name on the left and an input field on the right. Isn't that iOS control built in? If not, how is this done?

Thanks.

+4
source share
2 answers

You can achieve what you want by placing a text field in a UITableViewCell UITableView .

Then change the cell style during initiation to:

 cell.style = UITableViewCellStyleValue2; 

UITableViewCellStyleValue2 Style for a cell with a label on the left side of the cell with text aligned to the right and blue; on the right side of the cell is another label with smaller text that is left justified and black. The Phone / Contacts application uses cells in this style. Available in iOS 3.0 and later. Declared in UITableViewCell.h. A source

You can do the same directly in Interface Builder by changing the style to "Left Detail":

enter image description here

Result:

enter image description here

+1
source

This is not a built-in control for ios.if that you want to create, you can create a table view with a custom cell in which you can put a UILabel on the left side of the cell and put a UITextField on the right side of the cell for editing.

+4
source

Source: https://habr.com/ru/post/1391242/


All Articles