Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Roy
Visitor

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 3
RokuChris
Roku Employee
Roku Employee

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

You need to call SetGridStyle() before you call SetupLists() or SetListNames()
0 Kudos
Roy
Visitor

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
kyleabaker
Visitor

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.