将数据存储在行列表中

问题描述 投票:1回答:1

我像下面用XML创建我的RowList。

id = "CRowList"
      translation = "[ 0, 100]" 
      numRows = "15" 
      itemSize = "[ 130, 70 ]" 
      rowItemSize = "[ [90, 70],[90,70],[90,70] ]" 
      rowItemSpacing="[[54,0],[18,0]]"
      rowLabelOffset="[[0,8]]"
      itemSpacing = "[ 0, 10 ]" 
      showRowCounter="[true]"
      showRowLabel = "[ true, true ]" 
      drawFocusFeedback = "false" 
      vertFocusAnimationStyle = "fixedFocusWrap" 
      rowFocusAnimationStyle = "fixedFocusWrap" />

并且我在brs文件中获取数据,如下所示。在这里,我使用了xmlreader的自定义组件。它表现为xml从服务器接收的数据。我试图像下面的图像一样进行设置,并且我还引用了一个简单的RowList示例。在这里RowList。我想在这里在Content内部创建一个Content。像家长内容或孩子内容。我设置了父级内容,但是,它的行为仅像在图像的第1行和第2行下方一样显示标题,并且海报和标签数据来自子级内容。但我不知道该如何设置。

enter image description here

function init()

    ?"hello init() "

    m.CRowList = m.top.findNode("CRowList")
    m.readPosterGridTask = createObject("roSGNode", "XmlReader")
    m.readPosterGridTask.contenturi = "http://192.168.1.3/?file=AllChannel.xml"
    m.readPosterGridTask.observeField("content", "setpanels")
    m.readPosterGridTask.control = "RUN" 


    ?"hello rowlist"
    m.top.setFocus(true)

end function

function setpanels()

   ' ?"m.CRowList : " m.CRowList.content
    m.CRowList.content = m.readPosterGridTask.content 'here set bydefault to row title.
    i = 0
    while i < m.CRowList.content.getChildCount()
        ?"here displaya a data  : " m.CRowList.content.getChild(i).title
        ?"here hdposter url : "m.CRowList.content.getChild(i).hdposterurl
        i = i + 1
    end while
end function

在我的xml数据中,三项标签和每个标签两个属性1)标题和2)hdposterurl。但是我无法像下面的图像那样在此处进行设置。谢谢。

roku brightscript
1个回答
0
投票

我实际上只是昨天尝试使用RowList,但遇到了非常相似的问题。

我想尝试找出使用RowList的适当方法,因此我下载了RowList example referenced by the Docs并运行了它。

[运行时,尽管这些海报具有有效的uri,但我可以看到部分标题,但看不到海报中的图像。

我相信RowList本身存在错误,建议您改用MarkupGrid。它提供了许多相同的功能,同时更易于使用和减少了错误。

© www.soinside.com 2019 - 2024. All rights reserved.