简体   繁体   English

如何将 Roku Scenegraph GridView 转换为小写

[英]How to convert Roku Scenegraph GridView to lower case

I'm working on a scenegraph GridView app.我正在开发一个场景图 GridView 应用程序。 All of the row items are all lowercase.所有行项目都是小写的。

I would like to convert them to Upper case.我想将它们转换为大写。

I am using Roku Scenegraph Developer Extensions.我正在使用 Roku Scenegraph 开发人员扩展。 (SGDex) (新加坡证券交易所)

I have tried using UCase on the RowAA.我曾尝试在 RowAA 上使用 UCase。 This does change the title to Upper Case, but it breaks the script.这确实将标题更改为大写,但它破坏了脚本。

ie... IE...

title: UCase(fieldInJsonAA)标题:UCase(fieldInJsonAA)

    if fieldInJsonAA = "movies" or fieldInJsonAA = "series"

        mediaItemsArray = jsonAA[fieldInJsonAA]
        itemsNodeArray = []
        for each mediaItem in mediaItemsArray
            itemNode = ParseMediaItemToNode(mediaItem, fieldInJsonAA)
            itemsNodeArray.Push(itemNode)
        end for
        rowAA = {
           'title: fieldInJsonAA
           title: UCase(fieldInJsonAA)
           children: itemsNodeArray
        }

The method I tried the in Example does Change the row title to Upper Case.我在示例中尝试的方法确实将行标题更改为大写。 However, it breaks the script.但是,它破坏了脚本。

I figured it out.我想到了。 By default, the DetailsView expects the row title to be lower case, so it was omitting the 'play' or the 'episode' button when I changed it.默认情况下,DetailsView 期望行标题为小写,因此当我更改它时它省略了“播放”或“剧集”按钮。

By changing the Details view as follows, this allows the script to run with upper or lower case.通过如下更改详细信息视图,这允许脚本以大写或小写形式运行。

Details View...详情查看...

`''' Default Code''' 

if currentItem.url <> invalid and currentItem.url <> "" 
    buttonsToCreate.Push({ title: "Play", id: "play" }) 
else if details.content.TITLE = "series" 
    buttonsToCreate.Push({ title: "Episodes", id: "episodes" }) 
end if 

''''''''

''' Updated Code that works with lower or upper case''' 

if currentItem.url <> invalid and currentItem.url <> "" 
    buttonsToCreate.Push({ title: "Play", id: "play" }) 
else if details.content.TITLE = "series" 
    buttonsToCreate.Push({ title: "Episodes", id: "episodes" }) 
else if details.content.TITLE = "SERIES" 
    buttonsToCreate.Push({ title: "Episodes", id: "episodes" }) 
end if 

''''''''`

Can You try with something like this:你可以尝试这样的事情:

rowAA = {}
rowAA.title = UCase(fieldInJsonAA)
rowAA.children = itemsNodeArray

Or或者

rowAA = {}
rowAA["title"] = UCase(fieldInJsonAA)
rowAA["children"] = itemsNodeArray

EDIT: I initially understood that script doesn't compile.编辑:我最初了解到该脚本无法编译。

What I notice is that in Your ParseMediaItemNode method You are passing fieldInJsonAA without upperCase and then after it in rowAA You are passing the same fieldInJsonAA but but with upper case.我注意到的是,在您的 ParseMediaItemNode 方法中,您正在传递不带大写的 fieldInJsonAA,然后在 rowAA 中传递相同的 fieldInJsonAA,但使用大写。 Try to pass it in upper case in ParseMediaItemNode as well and check what happens.尝试在 ParseMediaItemNode 中以大写形式传递它并检查会发生什么。 That's a wild guess since I don't know much about script You are using.这是一个疯狂的猜测,因为我对您正在使用的脚本了解不多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM