Bonjour,
j'ai crée un bouton dans un UIViewController mais l'appel de son action se fait une fois sur 4, voici mon code :
l'appel se fait aléatoirement lorsque je clique dessus.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 UIButton * btn_tous = [[UIButton alloc] initWithFrame:CGRectMake(0, offset_y + 1, self.view.frame.size.width, 90)]; btn_tous.userInteractionEnabled = YES; [btn_tous addTarget:self action:@selector(openCarte) forControlEvents:UIControlEventTouchUpInside]; [btn_tous setBackgroundColor:[UIColor redColor]]; [main.view addSubview:btn_tous]; mainScrollView.contentSize = CGSizeMake(self.view.frame.size.width, 520); [mainScrollView addSubview:main.view];
Merci d'avance
Partager