UIButton dentro de UIScrollView no se activa al tocar. Por favor ayuda a resolverlo.UIButton dentro de UIScrollView no se activa al tocar
// Add a button
UIButton *btn1 = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
btn1.frame = CGRectMake(0, 0, 26, 18);
btn1.bounds = CGRectMake(0, 0, 30.0, 30.0);
[btn1 addTarget:self action:@selector(buttonClick1:)
forControlEvents:UIControlEventTouchUpInside];
[scrollView addSubview:btn1];
- (void)buttonClick1:(id)sender {
int dd = 4;
}
Compruebe la altura o el ancho de scrollView para ver si es 0, y habilite 'clipSubview' – onmyway133