I had this happen couple of years ago but I can't remember how I fixed it. Can anyone help refresh my memory?
I have scrollview, adding uibutton dynamically during runtime. Button shows up just fine, scrollview scrolls okay. The only problem is that the button title label is not touchable while other part of the button is touchable.
I've done something as simple as below and still got the same problem. It's almost like setTitle added a subview in the button that is not passing the events down to the button itself. I even try btn.titlelabel.userInteractionEnabled = YES as it was default to NO; and still no dice.
Code:
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn setTitle:@"123" forState:UIControlStateNormal];
btn.frame = CGRectMake(10,10, 100, 100);
[scrollView addSubview:btn];
The scrollview have all the touch event passing params that I can think of:
scrollView.userInteractionEnabled = YES;
scrollView.delaysContentTouches = YES;
scrollView.exclusiveTouch = YES;
scrollview.canCancelContentTouches = YES;
TIA!