如何找到可以从tvml DOM触发的事件?

时间:2015-11-20 07:50:58

标签: tvos tvml tvjs

来自Beginning tvOS Development with TVML Tutorial

向DOM添加事件时我很困惑。在此代码中

App.onLaunch = function(options) {
  //...
  //inside resourceLoader.loadResource...
  var doc = Presenter.makeDocument(resource);
  doc.addEventListener("select", Presenter.load.bind(Presenter)); //add this line
  Presenter.pushDocument(doc);
  //...
}

"select"来自哪里?

我怎么知道可以从某些元素中触发"select"事件,例如按钮?

这是否有任何文件?

1 个答案:

答案 0 :(得分:7)

我找到了答案。根据{{​​3}}示例代码:

  

有关可用事件的完整列表,请参阅TVMLKit DOM   文档。

搜索了一段时间后,我在TVML Catalog: Using TVML Templates

中找到了TVElementEventType
enum TVElementEventType : Int {
    case Play
    case Select
    case HoldSelect
    case Highlight
    case Change
}

这些是可以从tvml元素触发的事件。

相关问题