PhoneGap running the WWW package encountered problems

Source: Internet
Author: User

Recently, the company has been required to learn PHONEGAP packaging project I was the first time to start contact with a few of the feeling is good? Mostly Html5+js code

During this time I met a lot of problems

Question 1, the boss gave me a www bag called me to run a look at the effect of the iphone mobile phone boss may also not understand iOS (Boss is engaged in Android) said with WebView loaded so I wrote the code

Load local html    webView = [[UIWebView alloc] Initwithframe:cgrectmake (0,0,self.view.bounds.size.width, Self.view.bounds.size.height)];    NSString *htmlfile = [[NSBundle mainbundle] pathforresource:@ "login" oftype:@ "html"];    nsstring* htmlstring = [NSString stringwithcontentsoffile:htmlfile encoding:nsutf8stringencoding Error:nil];    NSString *path = [[NSBundle mainbundle] bundlepath];    Nsurl *baseurl = [Nsurl Fileurlwithpath:path];        [WebView loadhtmlstring:htmlstring Baseurl:baseurl];    BaseURL know the URL of the bundle, you can call the bundle of other files, pictures of music what    [Self.view Addsubview:webview];


That's what the interface seems to be showing, but it's got a lot of problems and I'm going to find a way

On the internet to find a variety of information found that the original use phonegap run WWW package when Xcode is not to write a code in which

The config file is a global profile that writes the interface to be displayed in <content src="login/login.html" /> This is the landing screen.

<?xml version= "1.0" encoding= "UTF-8"?><!--Licensed to the Apache software Foundation (ASF) under one or more con  Tributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");  You are not a use of this file except in compliance with the License. Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable law or AG Reed to in writing, software distributed under the License are distributed on a "as is" BASIS, without warranties OR Condi  tions of any KIND, either express or implied.     See the License for the specific language governing permissions and limitations under the License.--><widget xmlns = "Http://www.w3.org/ns/widgets" id = "Io.cordova.helloCordova" Version = "2.0.0" > <nam E>hello cordova</name> &LT;DESCRIPTION&GT    A Sample Apache Cordova application that responds to the Deviceready event.    </description> <author href= "Http://cordova.io" email= "[email protected]" > Apache Cordova Team </author> <access origin= "*"/> <!--<content src= "http://mysite.com/myapp.html"/> for Exter NAL pages--<content src= "login/login.html"/> <!--Preferences for IOS---<preference name= "Allowinlinemediaplayback" value= "false"/> <preference name= "Autohidesplashscreen" value= "true"/> <pre Ference name= "Backupwebstorage" value= "cloud"/>


So some of the runtime will appear three frames (because the WWW package is the boss sent me, he is engaged in Android) One click Cancel can also get the desired effect of the task can also be completed but click three times Cancel button who would not feel bored

Picture of attached piece 1:



Picture 2:



Picture 3:



For this problem, the boss can not say that I am also baffled the solution later found a clue on the stack overflow I tried for a while and finally succeeded.

Stack overflow It says something about what's on the Android. I took a closer look at the engineering Discovery Project there are two such documents



So I moved one of the files out of the package to the desktop and ran the program again and found that there was no problem.

Run as follows

1.



2.



3.





PhoneGap running the WWW package encountered problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.