Hi, I´m trying to create something like an own "adBanner" for a website in my app.
The Banner is a Button with an image, which is actually the banner graphic.
[_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];
here is my function for flipping the view
- (IBAction)showWebView:(id)sender {
XLog ("Button Clicked");
WebViewController *_webViewController = [[WebViewController alloc] init];
_webViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:_webViewController animated:YES];
}
in my _webViewController I want to show a UIWebView with an url
First I coded a Navigation Bar with Title
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];
and now I created a back Button
[ navBar showButtonsWithLeftTitle: @"Zurück" rightTitle:nil leftBack: YES];
My question Is How I can make my back Button to dismiss the Modal View again ? Or how can I set the action ?? Thank You for helping