【发布时间】:2015-02-04 14:34:54
【问题描述】:
我有一个带有 dojo spinwheelslot 的工作灯应用程序。
问题是在用户返回应用程序后,spinwheelslot 似乎无法正常工作。事情是这样发生的……
- 我打开应用程序后,spinwheelslot 工作正常,可以选择值并转到下一页。
- 在下一页我们有 2 个链接打开 InAppBrowser 将用户带到网站。在关闭 Inappbrowser 并返回到 spinwheel 页面时,spin 动作有点生涩,它也会在值之间停止(而不是移动到一个特定的选项)。由于这个原因,选项选择没有按预期工作。 有什么线索可能导致这种情况吗?
一种可能性是最近升级到 xcode 6.0。这个旋转轮之前已经工作了几个月。我们最近从 5.0 升级到 xcode 6。这可能是这个问题的起点,但我不确定。从那以后,我恢复了所有其他更新,但没有运气。更令人困惑的是,旋转轮在初始加载时工作正常,但在从 InappBrowser 返回时出现问题。
这是一个混合工作灯应用程序,这个问题似乎不会出现在 android 部分,而只会出现在 iphone/ipad 测试中。
代码sn-ps:
用于旋转轮初始化
var CRLSContainer = dojo.byId("CountryOrRegionAndLanguageSelectContainer");
var CRLSWidget = null;
if (WL.Client.getEnvironment() != 'ipad') {
CRLSWidget = new dojox.mobile.SpinWheel({
id:"spin1",
style:{marginLeft:"10px", marginRight:"10px"}});
} else {
CRLSWidget = new dojox.mobile.SpinWheel({
id:"spin1",
style:{marginLeft:"auto", marginRight:"auto", fontSize:"1.5em", width:"80%"}});
CRLSWidget.placeAt(CRLSContainer);
CRLSWidget.startup();
var CRLSSlot = new dojox.mobile.SpinWheelSlot({
id:"slot1",
items:Messages.CRLSOptions,
style:{textAlign:"center", width:"100%"}});
CRLSWidget.addChild(CRLSSlot);
对于 InappBrowser 调用
function openExternalURL(url, currViewName) {
if (WL.Client.getEnvironment() === 'android') {
dijit.registry.byId(currViewName).performTransition("externalWebpageContainerView", 1, "slide");
openWebViewOverlay(url);
} else {
window.open("blankWithSpinnyRedirectFunction.html?OpenIt&RedirectTo="+escape(url), "_blank", "toolbarposition=top,location=no,closebuttoncaption="+Messages.CloseButtonCaption);
}
}
更新:我设法通过将以下函数添加到 iphone native 下的 CDVMainViewController.m 来解决此问题
-
(void)viewWillAppear:(BOOL)动画{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { CGRect viewBounds = [self.webView bounds]; viewBounds.origin.y = 19; viewBounds.size.height = viewBounds.size.height - 19; self.webView.frame = viewBounds; } [超级viewWillAppear:动画]; }
【问题讨论】:
-
您能否提供一些代码或示例项目,其中只有一个骨架 spinwheelslot 和 inappbrowser 实现来重现此问题?
-
Idan,下面是启动 spinwheel 小部件的代码。
-
将其添加到问题正文中...
-
顺便说一句,Worklight 的哪个版本?每个版本都提供不同的 Dojo 库版本。还有哪个 iOS 版本?
-
Worklight 版本为 6.2.0-20140918-1910。问题出在目标 iOS 7 上。我在运行 iOS 8 的 iphone 上遇到了同样的问题
标签: ios xcode dojo ibm-mobilefirst