开发者

iPhone - Custom UITableViewCell with clickable UITextView

开发者 https://www.devze.com 2023-02-07 15:14 出处:网络
I created a custom UITableViewCell and placed a UITextView element on it. Now when I click on the UITextView inside the cell tableView:didSelectRowAtIndexPath: is not called (in the superview which is

I created a custom UITableViewCell and placed a UITextView element on it. Now when I click on the UITextView inside the cell tableView:didSelectRowAtIndexPath: is not called (in the superview which is a UITableViewController).

Should I make the UITextView "transparent" or 开发者_Go百科something? How can I do that? I get the same effect when adding a button.


Adjust the userInteractionEnabled property to NO

someTextView.userInteractionEnabled = NO;

Documentation here: http://developer.apple.com/library/ios/documentation/uikit/reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instp/UIView/userInteractionEnabled

Similar question here: iOS: Selecting through UITextView on custom UITableViewCell

0

精彩评论

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