Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

setGridStyle(), setDisplayMode() not working in roGridScreen

When I run the following code, I get a portrait-shaped poster with my image stretched vertically to fit (as if I had used "scale-to-fill"). No combination of arguments to setGridStyle() or setDisplayMode() makes any difference. What am I doing wrong?

function main()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.setupLists(1)
screen.setListNames(["my row"])

screen.setGridStyle("flat-landscape")
screen.setDisplayMode("zoom-to-fill")

o = {}
o.HDPosterUrl = "http://songza.com/api/1/station/1396578/image"
screen.setContentList(0, [o])
screen.show()

while true
msg = wait(0, port)
if msg.isScreenClosed() return -1
end while
end function
0 Kudos
3 Replies
Highlighted
Roku Employee
Roku Employee

Re: setGridStyle(), setDisplayMode() not working in roGridSc

You need to call SetGridStyle() before you call SetupLists() or SetListNames()
0 Kudos
Highlighted
Level 7

Re: setGridStyle(), setDisplayMode() not working in roGridSc

"RokuChris" wrote:
You need to call SetGridStyle() before you call SetupLists() or SetListNames()


OK, that fixed it. You really should update your docs to mention this.
0 Kudos
Highlighted
Level 7

Re: setGridStyle(), setDisplayMode() not working in roGridSc

"RokuChris" wrote:
You need to call SetGridStyle() before you call SetupLists() or SetListNames()


This documentation has still not been updated to reflect this requirement. Just ran into it myself. The page that needs to be updated is here:
http://sdkdocs.roku.com/display/sdkdoc/ifGridScreen#ifGridScreen-SetGridStylestyleasStringasVoid
0 Kudos