开发者

Modal view can be dismissed by swipe

开发者 https://www.devze.com 2023-01-10 22:16 出处:网络
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

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开发者_Go百科.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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号