如何在TVML目录模板中创建两个网格/架子?

时间:2019-03-20 04:25:28

标签: xcode tvml

目录模板允许在左侧创建菜单,并且应在右侧视图上显示相关内容。

使用以下代码,我只能看到只有一排图像的一个网格。如果我还添加20张图像,则所有图像都将排在一个标题为一行的一行中。

<document>
   <catalogTemplate>
      <banner>
         <title>Movies</title>
      </banner>
      <list>
         <section>
            <listItemLockup>
               <title>All Movies</title>
               <decorationLabel>6</decorationLabel>
               <relatedContent>
                  <grid>
                     <section>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_A.png" width="250" height="376" />
                           <title>Movie 1</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_B.png" width="250" height="376" />
                           <title>Movie 2</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 3</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 4</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 5</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 6</title>
                        </lockup>
                     </section>
                  </grid>
               </relatedContent>
           </listItemLockup>
         </section>
      </list>
   </catalogTemplate>
</document>

但是我需要两个标题不同的部分。因此,我复制了网格内容并再次粘贴。

<document>
   <catalogTemplate>
      <banner>
         <title>Movies</title>
      </banner>
      <list>
         <section>
            <listItemLockup>
               <title>All Movies</title>
               <decorationLabel>6</decorationLabel>
               <relatedContent>
                  <grid>
                     <section>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_A.png" width="250" height="376" />
                           <title>Movie 1</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_B.png" width="250" height="376" />
                           <title>Movie 2</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 3</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 4</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 5</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 6</title>
                        </lockup>
                     </section>
                  </grid>
                  <grid>
                     <section>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_A.png" width="250" height="376" />
                           <title>Movie 1</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_B.png" width="250" height="376" />
                           <title>Movie 2</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 3</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 4</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375_C.png" width="250" height="376" />
                           <title>Movie 5</title>
                        </lockup>
                        <lockup>
                           <img src="path to images on your server/Car_Movie_250x375.png" width="250" height="376" />
                           <title>Movie 6</title>
                        </lockup>
                     </section>
                  </grid>
               </relatedContent>
           </listItemLockup>
         </section>
      </list>
   </catalogTemplate>
</document>

但是它没有显示带有不同行图像的两个网格。  I need two grids( Public, Private)  under one section. 谁能帮我解决这个问题? 谢谢。

0 个答案:

没有答案