2010-10-20 6 views

Répondre

4

Créez un bouton avec le cadre CGRect (0, 0, 20, 20), puis ajoutez-le à la vue. [UIView addSubView] définir la cible du bouton.

UIButton *closeButton = [[UIButton alloc] initWithFrame: CGRectMake(0,0,20,20)]; 
[closeButton addTarget:self action:@selector(closeView) forControlEvents:UIControlEventTouchUpInside]; 
+2

Je pense que vous voulez dire '' 'UIButton * closeButton = [[UIButton alloc] initWithFrame: CGRectMake (0,0,20,20)];' '' –

Questions connexes