tags:

views:

33

answers:

1

Hi,

I am using this to add a text box and a button as a subview of label pLabel.

[pLabel addSubview:pTextbox]; [pLabel addSubview:pButton]; [self.view addSubview:pLabel];

When I run the application, I see both of them, but the text box or the button no longer responses to my touch. Could you please let me know how can I fix this?

Thanks.

+1  A: 

pLabel.userInteractionEnabled = YES;

This might not be an appropriate use of labels though. You might want to consider subclassing from something other than UILabel.

marcc
Thanks, it worked.
ebaccount