私は現在、touchesBeganを機能させるのに苦労しています。
私は現在、このセットアップを持っています
[UIView(UIViewController) -> UIScrollView -> UIView[holderView] -> UILabels[]]
UILabels
このようにプログラムで追加します
//UIViewController method
UILabel *etiquetaCantidad = [[UILabel alloc] initWithFrame:CGRectMake(350, idx * 35, 50, 30)];
[etiquetaCantidad setTextAlignment:NSTextAlignmentCenter];
[etiquetaCantidad setBackgroundColor:[UIColor azulBase]];
[etiquetaCantidad setTextColor:[UIColor whiteColor]];
[etiquetaCantidad.layer setCornerRadius:5];
[etiquetaCantidad setText:@"0"];
[etiquetaCantidad setUserInteractionEnabled:YES];
[etiquetaCantidad setTag:idx + 100];
[holderView addSubview:etiquetaCantidad];
しかし、私がしようとすると
// UIViewController
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"Touch realizado: %@", touches);
}
トリガーされていない、ここで見逃したもの???