我正在嘗試在我的應用中爲網站創建類似於自己的「adBanner」的東西。導航欄「返回」按鈕關閉模態視圖
橫幅是一個帶圖像的按鈕,實際上是橫幅圖形。
[_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];
這裏是我在我的_webViewController翻轉角度
- (IBAction)showWebView:(id)sender {
XLog ("Button Clicked");
WebViewController *_webViewController = [[WebViewController alloc] init];
_webViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:_webViewController animated:YES];
}
功能我想說明一個UIWebView與URL
首先,我編寫了一個導航欄用標題
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];
,現在我創建了一個返回按鈕
[ navBar showButtonsWithLeftTitle: @"Zurück" rightTitle:nil leftBack: YES];
我的問題是如何讓我的背部按鈕再次關閉該模式的看法? 或者我該如何設置動作?感謝您的幫助