J'essaie de créer quelque chose comme un "adBanner" pour un site Web dans mon application.Barre de navigation "retour" Bouton pour fermer la vue modale
La bannière est un bouton avec une image, qui est en fait le graphique de la bannière.
[_adBanner setBackgroundImage:[UIImage imageNamed:@"test_banner.png"] forState:UIControlStateNormal];
_adBanner.opaque = YES;
[self.view addSubview:_adBanner];
[(UIButton*) _adBanner addTarget:self action:@selector(showWebView:) forControlEvents:UIControlEventTouchUpInside];
[_adBanner release];
ici est ma fonction pour les retournements de la vue
- (IBAction)showWebView:(id)sender {
XLog ("Button Clicked");
WebViewController *_webViewController = [[WebViewController alloc] init];
_webViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:_webViewController animated:YES];
}
dans mon _webViewController Je veux montrer un UIWebView avec une url
D'abord, je codé une barre de navigation avec Titre
WebViewController.m:
// Setting Navigation Bar
CGRect navBarRect = CGRectMake(0.0f, 0.0f, 320.0f, 44.0f);
navBar = [ [ UINavigationBar alloc ] initWithFrame: CGRectMake(navBarRect.origin.x, navBarRect.origin.y, navBarRect.size.width, 45.0f)];
[ navBar setDelegate: self.view ];
[ self.view addSubview: navBar ];
[ navBar release];
// Setting TitleString
NSString* adClientTitleString = [ [ NSString alloc] initWithString:@"Client" ];
// Setting Title
[ navBar pushNavigationItem: [ [ UINavigationItem alloc ] initWithTitle:adClientTitleString ] ];
[ navBar setDelegate: self];
et maintenant j'ai créé un bouton retour
[ navBar showButtonsWithLeftTitle: @"Zurück" rightTitle:nil leftBack: YES];
Ma question est comment je peux faire mon bouton de retour pour fermer la Modal Voir à nouveau? Ou comment puis-je définir l'action? Merci d'avoir aidé