0
votes

There's a nested UITextField in the UITableViewCell and the userInteraction is initially set to NO. The table has 2 of these cells.

I'm trying to do the following:

  • tap on a UITableViewCell
  • the UITextField in the cell should be selected (userInteraction set to YES)
  • Keyboard should appear.

Everything works and I'm able to use the keyboard to make changes in the UITextField except that oddly, the typical blinking cursor is in the UITextField missing.

Am I missing anything here?

1
are you calling [myTextField becomeFirstResponder] when the cell is selected? - Alex Coplan
if your using a builtin cell style, your textfield or a part of it might be hidden beneath the cell.textLabel frame - Bushra Shahid
@Alex Coplan: Yup, doing just that. It's returning YES too and the keyboard shows up and as mentioned, editing works. - Ronnie Liew
@xs2bush: Hmm not likely because I do see the letters so if it's blocked the letters would have been too? - Ronnie Liew
maybe you are setting the cell text to textfield.text. thts hw u can see the text but no cursor - Bushra Shahid

1 Answers

0
votes

This is finally resolved and the solution is simple.

All I needed to do is to set the cell's selection style to none:

cell.selectionStyle = UITableViewCellSelectionStyleNone;

My cell has a custom selectedBackgroundView and when the selectionStyle is blue or grey, the blinking cursor won't show up.