Windows phone 8 修复IBM MobileFirst 6.3中的WP反弹问题
我找到了修复cordova中WP反弹的插件: 我想在我的MFP项目中实现这个插件 本机代码:Windows phone 8 修复IBM MobileFirst 6.3中的WP反弹问题,windows-phone-8,ibm-mobilefirst,Windows Phone 8,Ibm Mobilefirst,我找到了修复cordova中WP反弹的插件: 我想在我的MFP项目中实现这个插件 本机代码: void border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { browser.InvokeScript("eval", "FixWPBouncing.onmanipulationcompleted()"); } Javascript代码: exports.onmani
void border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) {
browser.InvokeScript("eval", "FixWPBouncing.onmanipulationcompleted()");
}
Javascript代码:
exports.onmanipulationcompleted = function () {
exports.target = null;
};
exports.fix = function (target) {
if (!POINTER_DOWN) { return; }
if (!(target instanceof HTMLElement) && target.length) {
target = target[0];
}
target.addEventListener(POINTER_DOWN, function () { exports.target = target; }, false); };
plugin.xml:
<js-module src="www/fix-wp-bouncing.js" name="fix-wp-bouncing">
<clobbers target="FixWPBouncing" />
</js-module>
<!-- windows phone 8 -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="FixWPBouncing">
<param name="wp-package" value="FixWPBouncing"/>
<param name="onload" value="true" />
</feature>
</config-file>
根据上面的代码,我的解释如下:
调用fixwpbuncing.fix(包装器)代码>=>它将调用javascript函数exports.fix,此函数的目的是在我们触摸元素时添加事件侦听器
void border\u ManipulationCompleted(对象发送者,ManipulationCompletedEventArgs)将触发javascript代码导出。onmanipulationcompleted
=>此配置的目的是自动加载本机代码,因此我不需要调用cordova.exec<js-module src="www/fix-wp-bouncing.js" name="fix-wp-bouncing">
<clobbers target="FixWPBouncing" />
</js-module>
因此,本机代码侦听器将始终触发javascript代码
我对改变逻辑感到困惑,比如:
因为从这个链接,我们用cordova.exec调用本机。
不自动加载并自动触发javascript代码。
如果我错了,请纠正我
你有什么想法在MFP项目中实现吗 如果要在混合应用程序中实现Cordova插件,必须遵循MobileFirst Platform Developer Center教程中提供的说明 未测试/支持基于其他指令实现它 当然,您可以选择在MauliLe1.1平台基础上使用“纯”科尔多瓦应用程序<强> 7.1 < /强>,否定需要通过与MPF相关的任何东西,而应遵循标准的科尔多瓦程序。
<js-module src="www/fix-wp-bouncing.js" name="fix-wp-bouncing">
<clobbers target="FixWPBouncing" />
</js-module>