Search code examples
tvostvml

Using an image with listItemLockup


I'd like to replace the text description with an image I created, so instead of this:

<listItemLockup>
            <title>TITLE</title>
            <decorationLabel>7</decorationLabel>
                <relatedContent>
                    <grid>
                        <section>
                            <lockup ......
                            </lockup>

                        </section>
                     </grid>
                </relatedContent>
</listItemLockup>

I've tried this:

<listItemLockup>
            <decorationImage src="Path to image here" />
            <decorationLabel>7</decorationLabel>
                <relatedContent>
                    <grid>
                        <section>
                            <lockup ......
                            </lockup>

                        </section>
                     </grid>
                </relatedContent>
</listItemLockup>

This doesn't work. Am I just misunderstanding the use of images within listItemLockup or am I missing something else?


Solution

  • Following the Apple Tv Markup Language Reference, you can add an <img> component inside a listItemLockup, so it will be:

    <listItemLockup>
      <img src="Path to the image" width="20" height="20"/>
      <decorationLabel>7</decorationLabel>
      <relatedContent>
         <grid>
            <section>
               <lockup ......
               </lockup>
             </section>
          </grid>
       </relatedContent>
    </listItemLockup>