简体   繁体   English

没有出现Worklight Windows Phone 8应用程序栏API(OptionsMenu)

[英]Worklight Windows Phone 8 Application Bar API (OptionsMenu) does not appear

Looking for some guidance on a WP8 worklight problem... 寻找有关WP8工作灯问题的指导...

Basically I'm trying to implement the WL.optionsMenu API for Windows Phone 8 to use the native Application Bar, but I'm unable to visually confirm that its appearing in the WL Browser simulator, and I'm not seeing anything on device either. 基本上,我正在尝试实现Windows Phone 8的WL.optionsMenu API以使用本机应用程序栏,但是我无法从视觉上确认其是否出现在WL浏览器模拟器中,并且我在设备上也看不到任何内容。 Here is IBM's documentation for the optionsMenu API. 是optionsMenu API的IBM文档。

There is no indication that special build settings are required, but I figured that may be an issue. 没有迹象表明需要特殊的构建设置,但是我认为这可能是一个问题。

Here is the code I use to initialize the optionsMenu in the Windows Phone 8 environment, the item I've inserted is a placeholder for what is actually in the project. 这是我用于在Windows Phone 8环境中初始化optionsMenu的代码,我插入的项目是项目中实际内容的占位符。

function wlEnvInit(){
    wlCommonInit();
    // Environment initialization code goes here
    WL.OptionsMenu.init({opacity: "0.5"});
    WL.OptionsMenu.addItem('homePage', function() {}, 'Go to Home', {image:'', enabled : true}); 
    WL.OptionsMenu.setEnabled(true);
    console.log(WL.OptionsMenu.getItem('homePage'));
}

If I inspect the worklight browser simulator, I see that its inserting some HTML to reflect the content, and I can view the properties of the initialized bar in the console with JQuery. 如果检查worklight浏览器模拟器,则会看到它插入了一些HTML以反映内容,并且可以使用JQuery在控制台中查看初始化栏的属性。 The console gives the following from my console.log() above" 控制台从上面的console.log()提供了以下内容:

    <option value="Go to Home" id="homePageId">Go to Home</option>

If I try to build to device I see nothing indicating an application bar is there. 如果尝试构建到设备,则看不到任何指示存在应用程序栏的信息。 The documentation for this feature in worklight is pretty shoddy, but there are a few android examples around that offered no comparable help. 在worklight中,此功能的文档非常次充,但是周围有一些android示例,它们没有提供类似的帮助。

In the MBS you should see it as a dropdown. 在MBS中,您应该将其视为下拉列表。

In the app, this is working fine. 在应用程序中,这工作正常。

JS: JS:

WL.OptionsMenu.init();
    WL.OptionsMenu.addItem("feedsTab", displayFeedsTab, Messages.navToFeeds, {image: 'feed.png', enabled: true});
    WL.OptionsMenu.addItem("aboutTab", displayAboutTab, Messages.navToAbout, {image: 'about.png', enabled: true});

nativeResources\\applicationBar: nativeResources \\应用程序任务栏:
2 images that follow WP8's icon guidelines. 2张符合WP8图标准则的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM