1

如果我进入菜单,返回,然后再次进入菜单,这个简单的 JS 代码似乎会导致我的 Pebble 应用程序崩溃并出现以下错误。有人能告诉我为什么会发生这种情况吗?谢谢!

图像用作 PNG 的位图 - http://imgur.com/iDlZxJY

[错误] ault_handling.c:93:应用程序错误!{0a21d6a3-cff2-43f5-bfe8-82b3a381d8fe} PC:0x5555aaaa LR:0x809e8c9

var UI = require('ui');
var Vector2 = require('vector2');

var main = new UI.Window({

});
var playerBattleAnimation = new UI.Image({
 // Horizontal, Vertical
  position: new Vector2(35, 100),
  size: new Vector2(35 , 35),
  image: 'images/standingattack1'
});    

main.add(playerBattleAnimation); 

main.show();

main.on('click', 'up', function(e) {
  var menu = new UI.Menu({
    sections: [{
      items: [{
        title: 'Pebble.js',
        icon: 'images/menu_icon.png',
        subtitle: 'Can do Menus'
      }, {
        title: 'Second Item',
        subtitle: 'Subtitle Text'
      }, {
        title: 'Third Item',
      }, {
        title: 'Fourth Item',
      }]
    }]
  });
  menu.on('select', function(e) {
    console.log('Selected item #' + e.itemIndex + ' of section #' + e.sectionIndex);
    console.log('The item is titled "' + e.item.title + '"');
  });
  menu.show();
});
4

0 回答 0