使用索引 0 处的新项目动态更新 RowList

问题描述 投票:0回答:1
我正在填充一个 RowList,它是 Grid Screen 的子级。行列表在启动时已填充。稍后,在用户交互之后,我需要添加到行列表。特别是,我需要在索引 0(新的第一行)中添加一个新行,将所有行向下移动。我可以添加新的行项目(正如我看到嵌入在该项目中的海报一样),但是行标题不显示。我已单步执行代码,似乎没有任何问题,但新添加的行没有显示行标题。

我尝试了以下代码的几种变体,但是,我无法显示“新”行的标题。

' Create a parent node for the RowList. parentRowlistNode = CreateObject("roSGNode", "ContentNode") continueNode = CreateObject("roSGNode", "ContentNode") continueNode.addFields( { "order": "most_recent", "TITLE": "Some new row" } ) continueNode.AppendChild(feedItem) newgridChildren = [] ' Update the RowList with the newly added row. rowList = gridScreen.FindNode("rowList") 'newgridChildren.Push(continueNode) for each gridChild in gridChildren newgridChildren.Push(gridChild) end for newgridChildren.Push(continueNode) 'rowList.content.Update({ ' children: newgridChildren '}, true) parentRowlistNode.Update({ children: newgridChildren }, true) gridScreen.content = parentRowlistNode
    
roku brightscript rowlist
1个回答
0
投票
我能够通过更改以下内容来解决此问题:

continueNode.addFields( { "order": "most_recent", "TITLE": "Some new row" } )

continueNode.Update( { "order": "most_recent", "TITLE": "Some new row" }, true )
    
© www.soinside.com 2019 - 2024. All rights reserved.