如何隐藏滚动条的ios中的PhoneGap-ios,jquery mobile 滚动条-mobile,cordova

2215人阅读
1.在IOS项目导入phoneGap SDK的库文件,可以采用工程引用的方法导入。
2.写一个js来封装好一些方法来调用本地项目里的方法,这里需要查看phoneGap里插件调用的api。如:
cordova.define(&cordova/plugin/localChart&,
function(require, exports, module) {
var exec = require('cordova/exec');
var LocalChart =
function() {
//这里getData就是调用本地里写的一个方法名称,chart_id是携带的参数,传给本地工程getData方法中的参数。
LocalChart.prototype.getData =
function(success, failed,chart_id) {
exec(success, failed,
&LocalChart&, &getData&, [chart_id]);
项目中需要定义一个类来接受从JS传来的消息 如:
@interface ChartPlugin:CDVPlugin{ &&
-(void)getData:(CDVInvokedUrlCommand*)
@implementation ChartPlugin
//这里getData要和 上边&exec(success, failed,&&LocalChart&,&&getData&,
[chart_id]); “getData”保持一致.具体请详情看phoneGap plugins&api.
- (void)getData:(CDVInvokedUrlCommand*)command
CDVPluginResult* pluginResult =
& & ChartDataManager *chartDataManager = [ChartDataManager
getInstance];
& &&NSString *chartId = [command.arguments
objectAtIndex:0];
& &&NSString *chartData = [chartDataManager
getChartDataByChartId:chartId];
&& &if(chartData){
&& & & & & & pluginResult = [CDVPluginResult
resultWithStatus:CDVCommandStatus_OK
messageAsString:chartData];
& & & }else{
& & & & & &pluginResult = [CDVPluginResult
resultWithStatus:CDVCommandStatus_ERROR
messageAsString:@&Arg was null&]
//这里是通过代理来将数据传递给js中。
& & [self.commandDelegate
sendPluginResult:pluginResult
callbackId:command.callbackId];
最后,你在JS中可以定义一个function来调用getData方法从本地工程中拉取数据。如:
var lc = cordova.require(&cordova/plugin/localChart&);
var dataReady =
function(data){
//这里拿到的数据进行解析。
jsonData = JSON.parse(data);
lc.getData(dataReady,dataError,chartId);
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:68187次
排名:千里之外
原创:27篇
转载:25篇
评论:14条
(1)(1)(1)(3)(3)(4)(6)(2)(3)(2)(1)(4)(6)(1)(3)(3)(1)(1)(8)ios - Phonegap / Cordova not working in ios8 - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I played around with the iOS 8 beta and noticed that Cordova/Phonegap is pretty much broken.
For me it is mainly the InAppBrowser that now doesn't show up.
what are your experiences?
Do you have a fix or an idea for a solution?
2,29112034
You can fix this with a bit of Javascript in your index.html (or install iOS 8 beta 2, which seems to have fixed the issue):
// temp fix for iOS8 beta, add it after the reference to cordova.js
// You don't actually require it for ios 8 beta 5
if (navigator.userAgent === undefined) {
navigator.__defineGetter__('userAgent', function() {
return("Mozilla/5.0 (iP CPU iPhone OS 8_0 like Mac OS X) AppleWebKit");
Did you find this question interesting? Try our newsletter
Sign up for our newsletter and get our top new questions delivered to your inbox ().
Subscribed!
Success! Please click the link in the confirmation email to activate your subscription.
A plain cordova sample app (e.g. "cordova create test") will load fine.
If you add any cordova plugins you will encounter problems in "iOSExec()", see "platform_www/cordova.js":
bridgeMode = navigator.userAgent.indexOf(' 5_') == -1 ? jsToNativeModes.IFRAME_NAV: jsToNativeModes.XHR_NO_PAYLOAD;
Change that to:
bridgeMode = jsToNativeModes.IFRAME_NAV;
and you can use plugins again. This will break backwards compatibility with iOS 5, but i doubt you will find anybody running iOS 5 and cordova today...
If you are using fastclick.js or backbone.js you will have to make some small modifications, too.
Just follow the error messages in Safari's webinspector.
4,818114770
In early iOS 8 Betas, Cordova/Phonegap apps were broken due to a user agent bug, but according to the
(WebKit section) this bug was officially fixed in iOS 8 Beta 3. (It was actually already fixed in iOS 8 Beta 2.)
Good to see that Apple has tested Cordova/Phonegap apps and fixed this issue.
A bit disappointing that the bug existed in the first place, but early betas always have lots of issues.
Update XCode to Beta 2 and it's working without any fix (tested with cordova 3.5.0).
You need to download the new version of XCode on the iOS Dev Center since autoupdate is not yet available for beta..
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled当前访客身份:游客 [
一个人有时真的挺好。
:缩小扫描不到了
:引用来自“it_hand”的评论亲,可以问你个问题不...
:亲,可以问你个问题不? 例如我编号替换为: 赵江...
:BroadcastReceiver静态注册的生命周期不和app一样...
:引用来自“新手v”的评论登陆页面用这种方法调用...
:免费提供App网页自动下载安装服务器!微信里无需...
:我用的是2.9.1的用js调用ios方法时报:DEPRECATI...
:引用来自“醉如潇”的评论怎么我的小米启动不了啊...
:怎么我的小米启动不了啊
今日访问:164
昨日访问:174
本周访问:699
本月访问:164
所有访问:149946
Xcode5 + phoneGap2.9搭建ios开发环境-配置-测试-归档上传/phoneG...
发表于2年前( 18:22)&&
阅读(19103)&|&评论()
0人收藏此文章,
小弟是做JAVA/Android的第一次搞这个ios,公司有mobile项目是使用phoneGap开发的,需要开发ios版本.什么都不会只能一点一点琢磨了……大神越过……
原文链接:
下载phoneGap2.9和安装Xcode5(目前最新版)
使用phoneGap/create命令创建项目
./create /Users/jiagaoyang/Documents/Workspace/Xcode/iphone com.wislong HelloWorld
首先进入phoneGap/ios/bin目录
./create+项目位置(事先创建好)+包名+项目名称。(号换成空格)
&遇到权限(Permission)错误:
-bash: ./create: Permission denied
./create: line 116: /Users/jiagaoyang/Documents/phoneGap-2.9.0/bin/replaces: Permission denied
上面创建项目会报没有权限错误解决方法如下(因为我第一次只给create权限了,所以才会有第二个错误,直接使用下面给所有的文件权限就可以了):
chmod 777 *
因为你本身就在bin目录中所以不用切换目录,意思是给bin下所有文件添加777权限(
777读写运行权限
遇到(empty folder)错误
Error: /Users/jiagaoyang/Documents/Workspace/Xcode/iphone is not empty. Please specify an empty folder.
这个是说你存放文件的目录不为空,它需要一个空文件夹,进去清空咯~
然后再使用创建项目命令如果什么也没有打印说明成功了。进入你刚创建的目录看看吧!
会发现一个文件后缀名是.xcodeproj的文件双击就会自动使用Xcode打开这个项目了。
默认打开目录结构如下图:
可以直接把你们android项目的www文件复制过来。里面引入的Cordova.js文件需要换成ios版本的
修改ios安装后在桌面的软件名字
默认是和项目名称相同(HelloWorld)找到.plist文件中Bundle display name修改后面值就可以了
修改默认启动文件配置www/index.html
找到Classes/AppDelegate.m文件添加如下代码
self.viewController.wwwFolderName = @"www/html";
self.viewController.startPage = @"index.html";
就会找www/html中index.html这个看你自己项目修改了。如下图:
ios打包/.app-.ipa
找到菜单Product-Build如果出现success……说明成功了,到左边找到products文件下面看看是不是有一个.app文件。
把这个文件拖到ITunes中然后再拖出来就神奇般的成.ipa文件了,这个时间你可以装到越狱机子上测试了。
先搞点设置:Product-Scheme-Edit Scheme&把下面标红的地方都改成Release默认应该是debug如下图:
搞完之后就可以做归档动作了。Product-Archive
libCordova.a文件找不到错误&
参考链接:
然后再次点击归档,中间可能会遇到一些证书使用授权点击允许就ok啦!!!
然后会自动打开归档界面(菜单window-Organizer)&
选中Archives可以查看到已经归档准备上传的APP,点击右边的Validate验证……DisTribute提交……你懂的。
发布到appStore慢
发布了2天上传一直停留在your application is being uploaded……最多我等待了5个小时,每次几乎都是说网络连接失败什么的。最后采用的方案是翻墙上传,当时在mac上翻墙没解决,最后在win翻墙,共享一个wifi网络……mac连接翻墙网络后再做上传,没到10分钟success啦!!!
更多开发者职位上
1)">1)">1" ng-class="{current:{{currentPage==page}}}" ng-repeat="page in pages"><li class='page' ng-if="(endIndex<li class='page next' ng-if="(currentPage
相关文章阅读

我要回帖

更多关于 jquery mobile 滚动条 的文章

 

随机推荐