Roku中的对话框使用

时间:2019-12-11 10:06:16

标签: roku brightscript

我试图显示一个对话框。我在Roku中创建一个普通应用程序。在主场景中,随着场景扩展,我在主场景中创建了一个孩子,并尝试显示对话框,还尝试在子场景中进行场景,并扩展了组件名称。在这里,我试着提到了亲爱的三种情况。第一个方案工作但两个方案生成接口,而不是成员。我需要在子级或组件内使用对话框。有什么解决办法吗?

第一种情况:

main.xml

<component name="RokuApp" extends="Scene">
</component>

“我的对话框逻辑”下方

main.brs

sub init()
  dialog = createObject("roSGNode", "Dialog")
  dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png"
  dialog.title = "Example Dialog"
  dialog.optionsDialog = true
  dialog.message = "Press * To Dismiss"
  m.top.dialog = dialog
end init()

第二种情况:

main.xml内创建一个ChildNode /另一种XML,并与Roku App组合。

Child.xml

<component name="Child" extends="Group">
</component>

Child.brs

sub init()
  dialog = createObject("roSGNode", "Dialog")
  dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png"
  dialog.title = "Example Dialog"
  dialog.optionsDialog = true
  dialog.message = "Press * To Dismiss"
  m.top.dialog = dialog ' ' Interface not a member of BrightScript Component (runtime error &hf3)
end init()

第三种情况:

main.xml内创建一个组件/另一种XML,并与Roku App组合。

Component.xml

<component name="Component" extends="RowList">
</component>

Component.brs

sub init()
  dialog = createObject("roSGNode", "Dialog")
  dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png"
  dialog.title = "Example Dialog"
  dialog.optionsDialog = true
  dialog.message = "Press * To Dismiss"
  m.top.dialog = dialog ' Interface not a member of BrightScript Component (runtime error &hf3)
end init()

但是,在这上面,所有三种情况仅在场景运行良好的情况下才得以扩展。在另一种情况下,这两种情况都会生成错误接口,而不是任何人都知道该解决方案的BrightScript Component成员(运行时错误&hf3)。

1 个答案:

答案 0 :(得分:0)

仅“场景”节点具有一个名为“对话框”的字段。 Group和RowList没有名为“对话框”的字段。