Can we display a UITextField in side a UILabel and this UILabel is a cell in UITableView.
Quote:
Originally Posted by funnylookinhat
Yes, there are a couple of ways you can do this.
The easiest way is to create UITableViewCells with Interface Builder, and put text fields in them. Link both the cell and the text field to whatever controller manages the datasource/delegate for the UITableView.
So for example, let's say you create the following:
Code:
IBOutlet UITableViewCell *cell1;
UITextField *text1;
IBOutlet UITableViewCell *cell2;
UITextField *text2;
IBOutlet UITableViewCell *cell3;
UITextField *text3;
In your cellForRowAtIndexPath function you would do the following:
Code:
if([indexPath row] == 0) {
return cell1;
} else if([indexPath row] == 1) {
return cell2;
} else {
return cell3;
}
Then you can just reference the text fields as normal - connect them with interface builder, etc.
Does that help?
|