是否可以在UIWebView上方显示模态视图?我有一个UIViewController,其中加载了一个WebView。然后,我想推送一个模态视图控制器,以便模态视图暂时覆盖WebView...
WebView正常工作;以下是它在视图控制器中的加载方式:
- (void)loadView {
// Initialize webview and add as a subview to LandscapeController's view
myWebView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
myWebView.scalesPageToFit = YES;
myWebView.autoresizesSubviews = YES;
myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
myWebView.delegate = self;
self.view = myWebView;
}
如果我试图在viewDidLoad中加载模态视图控制器,但是没有模态视图出现:
- (void)viewDidLoad {
[super viewDidLoad];
// Edit dcftable.html with updated figures
NSMutableString *updated_html = [self _updateHTML:@"dcftable"];
// Load altered HTML file as an NSURL request
[self.myWebView loadHTMLString:updated_html baseURL:nil];
// If user hasn't paid for dcftable, then invoke the covering modal view
if (some_condition) {
LandscapeCoverController *landscapeCoverController = [[[LandscapeCoverController alloc] init] autorelease ];
[self presentModalViewController:landscapeCoverController animated:YES];
}
}
我怀疑需要对UIWebView委托进行一些操作,以使其接收新的模态视图...但是无法在任何地方找到相关讨论或示例...再次强调目标是调用一个覆盖在WebView顶部的模态视图。
提前感谢您的任何想法!