Developers

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
Tags (1)
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()
Tags (1)
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.
Tags (1)
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
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!