"more" 文本截断按钮在 tvOS 中不起作用
"more" button with text truncation in tvOS doesn't work
我使用 tvml
开发 tvOS 应用程序。
由于描述中的文字很长,系统用more
按钮将长文字剪切成简短的描述。
但是,more
按钮不起作用。单击按钮后,它不会显示任何内容,应该会弹出一个包含所有说明的屏幕。
以下是部分代码。如果您能帮助我,我将不胜感激!
<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>
您需要对监听更多按钮点击的部分进行实际编码,并在警报视图中显示全文。此功能不会自动随描述组件一起提供。 Check out this tutorial 了解详情。转到名为 "Handling text overflow" 的部分,您将了解如何操作。
我使用 tvml
开发 tvOS 应用程序。
由于描述中的文字很长,系统用more
按钮将长文字剪切成简短的描述。
但是,more
按钮不起作用。单击按钮后,它不会显示任何内容,应该会弹出一个包含所有说明的屏幕。
以下是部分代码。如果您能帮助我,我将不胜感激!
<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>
您需要对监听更多按钮点击的部分进行实际编码,并在警报视图中显示全文。此功能不会自动随描述组件一起提供。 Check out this tutorial 了解详情。转到名为 "Handling text overflow" 的部分,您将了解如何操作。