Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 

New member need help

Hi I am trying to make a dialog with button content. If the content is big then the dialog doesn't scroll even if I set a maxHeight. The dialog overlaps the screen.

What do I need to do?

<Dialog
        id="MonthDialog"
        title="SELECT A MONTH"
        iconUri=""
        maxHeight="300"
        optionsDialog="true"
        visible="false"/>
Buttons = ["asd","asd","asd","asd","asd","asd","asd","asd","January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
m.top.dialog.buttons = buttons
0 Kudos
1 Reply
speechles
Level 7

Re: New member need help

Yup that stock dialog sucks. The buttons/text do not scale. The buttons/text do not scroll. The dialog will basically center itself and anything outside will bleed out. You see the center of the dialog not the very top or very bottom. Yup. That is normal.

You kinda need to roll-your-own component to get there. You can use a rectangle to start your dialog. Then everything inside the rectangle put it all into a main rectangle layout group. Put a poster and a label at the top centered within a second layout group and a third layout group for your body. So you have two layout groups the title and the body within the main layout group. The title is a poster(icon) and label(text). The body is text used for scrolling labellist(text that works like buttons).

Put a 2 line rectangle between the title layout group and the labellist layout group. That will be the line to separate them. Put a labellist under that to be your buttons. The label list can scroll and you can easily set the amount of visible items. You will have to roll-your-own onkeyevent to handle the label list but that is easy. You have more control this way as you can wrap from top->bottom and bottom->top which the stock dialog buttons refuse to do. 

I would advise you look into building your own dialog with rectangle and only use the stock dialog when you have items that do not need to scroll to select. Look at how to use layout group. Along with poster, label, and labellist and you will see how to make your own dialog. It isn't that much harder than the stock dialog to build/navigate but you will have to write more code and understand what you are writing.
0 Kudos