gpt4 book ai didi

ios - 如何将网页设置为PhoneGap startPage?

转载 作者:行者123 更新时间:2023-11-29 13:36:54 26 4
gpt4 key购买 nike

最近开始在iOS平台学习PhoneGap,遇到了一个问题。如何更改 startPage?我将 startPage 设置如下:

self.viewController.startPage = @"http://www.google.com";

没用,我也试了下面的方法:

 NSURLRequest *request =       
[NSURLRequest requestWithURL:[URL URLWithString:@"http://www.google.com"]];

它也没有用。

我不知道该怎么做。有没有人可以帮助我?

最佳答案

这是我为我的申请所做的。按照 phonegap 的预期创建本地 index.html 页面。在 html 中,将 window.location 设置为您需要它转到的任何页面。

这是我的 index.html:

<html>
<head>
<script> window.location.href='http://www.google.com' </script>
</head>
<body>
<h1 class='loading'> Loading </h1>
</body>
</html>

注意:确保将 http:// 放在该位置,否则它可能会被视为相对链接。

关于ios - 如何将网页设置为PhoneGap startPage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10362224/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com