Documentation Archive

Developer

Apple TV Markup Language Reference

divTemplate

Use the div template (divTemplate) to create pages that do not conform to a layout defined by another template. There is no built-in layout for the contained elements. The divTemplate element creates a view where the elements it contains are arranged using the tv-align and tv-position styles. Containing elements are centered by default. Figure 6-1 shows the positions inside of the divTemplate element. The div template should only be used when you can’t use another template to achieve the look you want. The theme for the div template defaults to the system preference.

Figure 6-1divTemplate element layout image: ../Art/containing_element_2x.png

Elements contained in the same position, are arranged from the top of the cell to the bottom of the cell, with regards to the order they are specified in the divTemplate element. You can specify a <background><img /></background> that displays a background image inside of the divTemplate. The background image is top-aligned and is fitted to the size of the divTemplate while keeping the image’s original aspect ratio. Text wrapping inside of the divTemplate only occurs in the header, center, and footer positions.