views:

18

answers:

0

I have encountered a strange behaviour when presenting my modal view. I have a scroll view on as my main view with 4 pages... tapping on a button on the scroll view presents the modal view, but i can dismiss the modal view by swiping left or right. Obviously i just want to be able to dismiss using the Done button.

This is the method i use to display the modal view:

- (void)popUpModal:(id)sender {

UIViewController *detailView = [[UIViewController alloc] initWithNibName:@"KeyboardView" bundle:nil];
detailView.view.backgroundColor = [UIColor blackColor];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:detailView];

UIBarButtonItem * doneButton =
[[UIBarButtonItem alloc]
 initWithBarButtonSystemItem:UIBarButtonSystemItemDone
 target:self action:@selector(doneAction) ];

detailView.navigationItem.rightBarButtonItem = doneButton;

[doneButton release];


UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];

NSString *url = @"http://www.google.com";

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];


[detailView.view addSubview:webView];

[self presentModalViewController:navController animated:YES];

[detailView release];

[navController release];

}

What would cause this behaviour?

Thanks.