I’ve added a UITextView to my cell. If the userclicks on the cell where the UITextView then then didSelectRowAtIndexPath: is not called unless they click the area where the UITextView is not covering. Is there a work around or what is it I have done wrong?
UITextView *txtview = [[UITextView alloc] initWithFrame:CGRectMake(75, 1, 250, 34)];//init and create the UIWebView
txtview.autoresizesSubviews = NO;
//txtview.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
[txtview setBackgroundColor:[UIColor grayColor]];
[txtview setFont:[UIFont fontWithName:@"Helvetica" size:15]];
txtview.textColor = [UIColor blackColor];
txtview.scrollEnabled = NO;
[txtview setOpaque:NO];
//[txtview setDelegate:self];
txtview.editable = NO;
txtview.text = aBlogRss.title;
[txtview setContentInset:UIEdgeInsetsMake(-11,-8,0,0)];
//[txtview loadHTMLString:htmlString baseURL:nil];
[cell addSubview:txtview];
[txtview release];
Many Thanks,
-Code
I think the solution is actually
This will pass touches to the parent view.. or in this case the
UITableViewCell. If you are doing this in multiple places it would be a good idea to subclassUITAbleViewCell.Alternatively, you could make your class a UITextViewDelegate, set your txtView.delegate to self, and implement
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView,and then select the proper
UITableViewCellthroughself.tableview.. But that would be nothing short of a hack.