1

我已经阅读了几乎所有与该主题相关的帖子 - 但我无法找到完整的代码/适当的答案

我正在尝试在 iPhone PhoneGap 应用程序中添加两个 PhoneGap WebView。

下面是代码

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    CGRect screenBounds = [[UIScreen mainScreen] bounds];

    self.cleaver1 = [[[MainViewController alloc] init] autorelease];
    self.cleaver2 = [[[MainViewController alloc] init] autorelease];

    self.cleaver1.view.frame = CGRectMake(0, 0, 320, 200);
    self.cleaver2.view.frame = CGRectMake(0, 100, 320, 420);

    self.cleaver1.wwwFolderName = @"www";
    self.cleaver1.startPage = @"navigation.html";
    self.cleaver2.wwwFolderName = @"www";
    self.cleaver2.startPage = @"mail.html";

    TestViewController *vc = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];

    [vc.view addSubview:self.cleaver1.view];
    [vc.view addSubview:self.cleaver2.view];

    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];

    return YES;
}

两者,webviews 正在加载“index.html”,它没有按预期工作。

请建议我,PhoneGap 是否支持多个 WebViews?

4

0 回答 0