我可以使用网络语言 (HTML - CSS - jQuery) 创建 iphone 应用程序 (IOS) 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4908970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I create iphone app (IOS) using web's languages ( HTML - CSS - jQuery )?
提问by faressoft
Can I create iphone app (IOS) using web's languages ( HTML - CSS - jQuery ) ? How can I star that ?
我可以使用网络语言 (HTML-CSS-jQuery) 创建 iphone 应用程序 (IOS) 吗?我怎么能加星标?
回答by Wayne Hartman
There are a number of different approaches you can take.
您可以采用多种不同的方法。
First, there's creating iPhone WebApps. This approach give you a number of different Mobile Safari APIs that expose internal capabilities through the Safari Browser.
首先,创建iPhone WebApps。这种方法为您提供了许多不同的 Mobile Safari API,它们通过 Safari 浏览器公开内部功能。
Second, you can create a native application that contains a UIWebView. Other than this detail, the approach would be the same as the first, exclusively using the APIs for Mobile Safari.
其次,您可以创建一个包含 UIWebView 的本机应用程序。除了这个细节之外,该方法将与第一个相同,专门使用 Mobile Safari 的 API。
Lastly, you can take an approach of using a third-party SDK, like Titaniumor PhoneGap. This approach gives you a base set of APIs that you leverage for not only making iPhone webapps, but an app that works on other mobile platforms as well.
最后,您可以采取使用第三方 SDK 的方法,例如Titanium或PhoneGap。这种方法为您提供了一组基本的 API,您不仅可以利用这些 API 来制作 iPhone 网络应用程序,还可以利用这些 API 来制作适用于其他移动平台的应用程序。
Good luck!
祝你好运!
回答by BlackSheep
For create a Games you can use GameSalad or Stencyl, have own code very simple.
对于创建游戏,您可以使用 GameSalad 或 Stencyl,拥有非常简单的自己的代码。
For Utility, use Titanium or PhoneGap using HTMLcode jQuery, jQTouch
对于实用程序,使用 Titanium 或 PhoneGap 使用 HTMLcode jQuery、jQTouch
Or you can use xcode:
或者你可以使用 xcode:
1) create your webApp using you prefer software, during the process you can testing on the iPhoneSimulator simple to drang and drop index file inside the simulator.
1) 使用您喜欢的软件创建您的 webApp,在此过程中,您可以在 iPhoneSimulator 上进行测试,只需在模拟器内拖放索引文件即可。
2) open Xcode and create a single view application.
2) 打开 Xcode 并创建一个单视图应用程序。
3) in the first view of your app by interface builder add a full screen UIWebView.
3) 通过界面构建器在您的应用程序的第一个视图中添加一个全屏 UIWebView。
4) drag and drop the root folder of your webApp in your project and copy a folder:
4)将你的webApp的根文件夹拖放到你的项目中,复制一个文件夹:
Make sure to creare a Folder and not a Group.
确保创建文件夹而不是组。
5) implement your ViewController.h:
5) 实现你的 ViewController.h:
@interface HTMViewController : UIViewController {
UIWebView *homePage;
}
@property (nonatomic, strong) IBOutlet UIWebView *homepage;
6) and your ViewController.m
6) 和你的 ViewController.m
@synthesize homepage;
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"MyFolder"];
NSData *htmlData = [NSData dataWithContentsOfFile:htmlFile];
[homepage loadData:htmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@"index.html"]];
}
7) from interface builder link the web view to a reference, and setting the UI has you want.
7) 从界面生成器将 Web 视图链接到参考,并设置您想要的 UI。
Like remove bounce, detect address, phone numbers, link ext.
像删除反弹,检测地址,电话号码,链接分机。
Now you have integrated your web app in a native project ;)
现在您已将您的 Web 应用程序集成到本机项目中;)
Hope this help.
希望这有帮助。
pls vote if you think my contribute is good.
如果您认为我的贡献很好,请投票。
回答by Marco Mustapic
回答by user2111849
回答by Flafla2
Yes, you can. You would do this by making a webpage, and attaching that webpage to a UIWebView. You will still need Xcode and other iOS developer tools to work the minimal code you need to write. Take a look at developer.apple.com for information on how to get these things and on how to write simple webview code.
是的你可以。您可以通过制作网页并将该网页附加到 UIWebView 来做到这一点。您仍然需要 Xcode 和其他 iOS 开发人员工具来运行您需要编写的最少代码。查看 developer.apple.com 以获取有关如何获取这些内容以及如何编写简单的 webview 代码的信息。