新的Roku scenegraph扩展看起来非常有用。我有两个SGDEX视图对我很有用。但是,我需要将它们结合在一起,而且我没有看到任何关于如何做到这一点的文档。
Custom+Scene示例是我正在研究的内容。简单地说,我将添加searchView特性到这个脚本中。
我尝试过添加SearchView作为组件。然而,搜索视图示例是它自己的工作页面,我想将它添加为一个节点。我试着把它作为一个悬空添加,也尝试添加它作为一个按钮在主页上。这两件事我都失败了。
请参阅scenegraph扩展。
我只需将SearchView特性添加到SGDEX中的Custom+Scene示例中即可。如果你熟悉的话,请举例说明如何做到这一点。谢谢。
发布于 2019-08-07 01:30:33
更新的
看起来,我们想要实现的是从searchView示例的主要场景打开custom+screen。
我更新了项目的feed.json文件,并在“串联”对象之后添加了一个新对象。
...
...
"search": [
{
"id": "search",
"title": "Search",
"releaseDate": "2015-06-11",
"shortDescription": "Will open search view.",
"thumbnail": "http://level2creative.com/wp-content/uploads/2017/08/image-search-ss-1920-800x450.gif",
"genres": [
"search"
],
"tags": [
"search"
],
"content": {
"dateAdded": "2015-06-11T14:14:54.431Z",
"captions": [],
"videos": [
{
"url": "http://roku.content.video.llnw.net/smedia/59021fabe3b645968e382ac726cd6c7b/Gb/siCt-V7LOSU08W_Ve1ByJY5N9emKZeXZvnrH2Yb9c/117_segment_2_twitch__nw_060515.mp4",
"quality": "HD",
"videoType": "MP4"
}
],
"duration": 53
}
}
]在您的GridHandler.brs上,更改ParseJsonToNodeArray函数,让我们更改第27行的if条件,如下所示:
if fieldInJsonAA = "movies" or fieldInJsonAA = "series" or fieldInJsonAA = "search"然后,在您的mainscene.brs上,转到"OnGridItemSelected“方法,将其改为如下所示:
rowContent = grid.content.GetChild(selectedIndex[0])
if rowContent.title = "search"
searchView = CreateObject("roSGNode", "SearchView")
searchView.hintText = "Search for something"
m.top.ComponentController.CallFunc("show", {
view: searchView
})
else
detailsView = ShowDetailsView(rowContent, selectedIndex[1])
detailsView.ObserveField("wasClosed", "OnDetailsWasClosed")
end if这将打开searchView,如果您按下后向,则应该关闭searchView并将用户带回到gridView。
https://stackoverflow.com/questions/57343114
复制相似问题