Search code examples
tvosapple-tv

"more" button with text truncation in tvOS doesn't work


I use tvml to develop tvOS app.

Because of long text in description, the system cuts the long text into short description with more button.

However, the more button doesn't work. Once click the button, it doesn't show up anything, and it's supposed to pop up a screen with all descriptions inside.

Below is part of code. If you can help me, I really appreciate it!

<document>
  <head>
    <style>
    </style>
  </head>
  <compilationTemplate theme="dark">
    <list>
      <relatedContent>
        <itemBanner>
          <heroImg src="${this.BASEURL}images/stackImage/stack01.png" width="650" height="650" />
        </itemBanner>
      </relatedContent>
      <header>
        <title>This is a title</title>
        <subtitle>Aware</subtitle>
        <row>
          <text>120 minutes</text>
        </row>
      </header>
      <section>
        <description allowsZooming="true">This is the long description!This is the long description!This is the long description!This is the long description!This is the long description!This is the long description!
        </description>
      </section>
      <section>
        <listItemLockup autoHighlight="true" videoURL="videoURL">
          <ordinal minLength="2">1</ordinal>
          <title>This is the subject</title>
          <decorationLabel>15:28</decorationLabel>
        </listItemLockup> 
  </section>
</list>


Solution

  • You need to actually code the part that listens to the click on the more button, and present the full text in a an alert view. This functionality does not come automatically with the description component. Check out this tutorial for the details. Go to the sections called "Handling text overflow", and you will see how to do it.