2013-06-26 1 views

Répondre

0

Essayez de mettre l'image dans un premier bouton:

UIImage *theImage = [UIImage imageNamed:@"image.png"]; 
UIButton *theButton = [UIButton buttonWithType:UIButtonTypeCustom]; 
theButton.bounds = CGRectMake(0, 0, theImage.size.width, theImage.size.height); 
[theButton setImage:theImage forState:UIControlStateNormal]; 
UIBarButtonItem *theBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:theButton]; 


[theButton addTarget:self action:@selector(MenuSlider:) forControlEvent:UIControlEventTouchUpInside]; 
self.navigationItem.leftBarButtonItem = barItem; 
+0

puis-je ajouter l'action comme je l'ai fait ci-dessus? –

+0

Oui, cela devrait fonctionner. – woz

+1

Ok, donc ça marche bien à part ça ne fait pas de merde:/Je peux sélectionner le bouton mais il ne va pas effectuer mon IBAction .... –

Questions connexes