Reputation: 4921
I have a standard UITableViewController
. In the cellForRowAtIndexPath
I add a subview to cell.contentView
. This UIView
itself contains a UITextField
object. This object will not respond to touches. I have set the delegate to the UIView and implemented all the methods. I have also set userInteractionEnabled = YES
. When I tap the UITextField
nothing happens! I feel it's being absorbed by the cell. What would be the easiest, least messy fix?
Best, Joris
EDIT: Sorry, see my answer. I solved it.
Upvotes: 0
Views: 816
Reputation: 4921
I'm an idiot. Sorry for wasting everyone's time. I hadn't properly said the UIView's frame. It of course did display the UI elements, but wouldn't respond to them.
Upvotes: 1
Reputation: 785
Try setting the editing property of the table view to YES. Check this answer
Editing a UITextField inside a UITableViewCell fails
Upvotes: 0
Reputation: 17732
Try just adding the textfield as a subview of the cell, this is what I have done in a couple of my apps and had no problems with it
Upvotes: 0