开发者

UITextView in custom UITableViewCell not responding to didSelectRowAtIndexPath

I have a UITextView in my custom UITableViewCell and the issue is that when I tap on it it won't respond to the didSelectRowAtIndexPath or even swipe events. How can I fix this? This UITextView is not editable. The reason why I use this over a UITextField is because I want to be开发者_Python百科 able to detect links easily.


I realize this is an old question, but I recently had the same issue. The fix in my case was to simply turn off "User Interaction Enabled" for the UITextView.


you need to forward the touch messages from UITableView to UITextView

UITextView inside UITableView


The first idea that came to mind...

In cellForRow set the textfield tag as the indexpath.row

Implement - (void)textViewDidBeginEditing:(UITextView *)textView

Based on this textView.tag, call the selectrow

    [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:textView.tag inSection:<#(NSUInteger)#>] 
animated:<#(BOOL)#> scrollPosition:<#(UITableViewScrollPosition)#>]


I don't know if it's what are you looking for But in my case i had a custom cell with UIImage, and UITextView and only when I clicked on UIImageView i got didSelectRowAtIndexPath recogniser. Make sure UITextView is user interections unable like that to fix the problem


Check if your TableView Selection property is set to NO

Wrong : tableView.allowsSelection = false

DidSelect Wont be called It has to be: tableView.allowsSelection = true

Also Check your Nib

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜