Possible Duplicate:
Having a UITextField in a UITableViewCell
I try to do it for a couple of days, but I found nothing useful so my question is: how can I create UITableViewCell UITextField Like?
Possible Duplicate:
Having a UITextField in a UITableViewCell
I try to do it for a couple of days, but I found nothing useful so my question is: how can I create UITableViewCell UITextField Like?
You can add it to cell contentView like this
UITextField *textField = [[UITextField alloc] initWithFrame:rect];
textField.tag = textTag;
//Add textfield to contentView
[cell.contentView addSubview:textField];
Remember to tag it, because when you reuse a cell the contentView is NOT cleared, so you should just use the same UITextView to get it later like this:
UITextField *textField = (UITextField *)[cell.contentView viewWithTag:textTag];
Additionally I have noticed the first time you create it, and add your textfield to the contentView and then modify the mainLabel, that subview will go on top so before returning the cell do this:
[cell.contentView bringSubviewToFront:textField];
just add the UITextField
to a UITableViewCell
like this..
UITextField* textField = [[UITextField alloc] initWithFrame:frame];
[cell addSubview:textField];
You can create this in the interface builder. Drag a UITableViewCell into the work area, put in your UILabel or UITextField. You can customize the look if you want.
Now in your view controller, declare an IBOutlet for this UITableViewCell. When the program calls cellForRowAtIndexPath, you can simply make cell equal to that variable.
Another approach is to add a UITextField in the cell's contentview programmatically.
You can create a UIView with some UILabels and some UITextField inside. And with the library and the property cornerRadious of the layer of the view you cand do the rounded borders